Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/bbcode/formatter/dist/ |
Upload File : |
{"version":3,"file":"formatter.bundle.js","sources":["../src/node-formatter.js","../src/formatter.js"],"sourcesContent":["import { Type } from 'main.core';\nimport {\n\tBBCodeNode,\n\ttypeof BBCodeElementNode,\n\ttypeof BBCodeRootNode,\n\ttypeof BBCodeTextNode,\n} from 'ui.bbcode.model';\nimport { type FormatterData, typeof Formatter, type FormatterElement } from './formatter';\n\nexport type ConvertCallbackOptions = {\n\tnode: BBCodeElementNode | BBCodeRootNode | BBCodeTextNode,\n\tformatter: Formatter,\n\tdata: FormatterData,\n};\n\nexport type ValidateCallbackOptions = ConvertCallbackOptions & {};\nexport type BeforeConvertCallbackOptions = ConvertCallbackOptions & {};\nexport type ForChildCallbackOptions = ConvertCallbackOptions & {\n\telement: FormatterElement,\n};\nexport type AfterCallbackOptions = ForChildCallbackOptions & {};\nexport type FormatterCallbackResult = Object | null;\n\nexport type NodeFormatterOptions = {\n\tname: string | Array<string>,\n\tconvert: (ConvertCallbackOptions) => FormatterCallbackResult,\n\tvalidate?: (ValidateCallbackOptions) => boolean,\n\tbefore?: (BeforeConvertCallbackOptions) => BBCodeNode | null,\n\tafter?: (AfterCallbackOptions) => FormatterCallbackResult,\n\tforChild?: (ForChildCallbackOptions) => FormatterCallbackResult,\n\tformatter?: Formatter,\n};\n\ntype DefaultNodeConverterOptions = ConvertCallbackOptions | BeforeConvertCallbackOptions;\ntype DefaultElementConverterOptions = ForChildCallbackOptions | AfterCallbackOptions;\n\nconst nameSymbol: Symbol = Symbol('name');\nconst groupSymbol: Symbol = Symbol('group');\nconst validateSymbol: Symbol = Symbol('validate');\nconst beforeSymbol: Symbol = Symbol('before');\nconst convertSymbol: Symbol = Symbol('convert');\nconst forChildSymbol: Symbol = Symbol('forChild');\nconst afterSymbol: Symbol = Symbol('after');\nconst formatterSymbol: Symbol = Symbol('formatter');\n\nconst defaultValidator = () => true;\nconst defaultNodeConverter = ({ node }: DefaultNodeConverterOptions) => node;\nconst defaultElementConverter = ({ element }: DefaultElementConverterOptions) => element;\n\nexport class NodeFormatter\n{\n\t[nameSymbol]: string = 'unknown';\n\t[groupSymbol]: ?Array<string> = null;\n\t[validateSymbol]: (ValidateCallbackOptions) => boolean;\n\t[beforeSymbol]: (BeforeConvertCallbackOptions) => FormatterCallbackResult = null;\n\t[convertSymbol]: (ConvertCallbackOptions) => FormatterCallbackResult = null;\n\t[forChildSymbol]: (ForChildCallbackOptions) => FormatterCallbackResult = null;\n\t[afterSymbol]: (AfterCallbackOptions) => FormatterCallbackResult = null;\n\n\tconstructor(options: NodeFormatterOptions = {})\n\t{\n\t\tif (Type.isArray(options.name))\n\t\t{\n\t\t\tthis[groupSymbol] = [...options.name];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.setName(options.name);\n\t\t}\n\n\t\tif (!Type.isNil(options.formatter))\n\t\t{\n\t\t\tthis.setFormatter(options.formatter);\n\t\t}\n\n\t\tthis.setValidate(options.validate);\n\t\tthis.setBefore(options.before);\n\t\tthis.setConvert(options.convert);\n\t\tthis.setForChild(options.forChild);\n\t\tthis.setAfter(options.after);\n\t}\n\n\tsetName(name: string)\n\t{\n\t\tif (!Type.isStringFilled(name))\n\t\t{\n\t\t\tthrow new TypeError('Name is not a string');\n\t\t}\n\n\t\tthis[nameSymbol] = name;\n\t}\n\n\tgetName(): string\n\t{\n\t\treturn this[nameSymbol];\n\t}\n\n\tsetValidate(callback: (ValidateCallbackOptions) => boolean)\n\t{\n\t\tif (Type.isFunction(callback))\n\t\t{\n\t\t\tthis[validateSymbol] = callback;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis[validateSymbol] = defaultValidator;\n\t\t}\n\t}\n\n\tvalidate(options: ValidateCallbackOptions): boolean\n\t{\n\t\tconst result: ?boolean = this[validateSymbol](options);\n\t\tif (Type.isBoolean(result))\n\t\t{\n\t\t\treturn result;\n\t\t}\n\n\t\tthrow new TypeError(`Validate callback for \"${this.getName()}\" returned not boolean`);\n\t}\n\n\tsetBefore(callback: (BeforeConvertCallbackOptions) => FormatterCallbackResult)\n\t{\n\t\tif (Type.isFunction(callback))\n\t\t{\n\t\t\tthis[beforeSymbol] = callback;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis[beforeSymbol] = defaultNodeConverter;\n\t\t}\n\t}\n\n\trunBefore(options: BeforeConvertCallbackOptions): FormatterCallbackResult\n\t{\n\t\treturn this[beforeSymbol](options);\n\t}\n\n\tsetConvert(callback: (ConvertCallbackOptions) => FormatterCallbackResult)\n\t{\n\t\tif (!Type.isFunction(callback))\n\t\t{\n\t\t\tthrow new TypeError('Convert is not a function');\n\t\t}\n\n\t\tthis[convertSymbol] = callback;\n\t}\n\n\trunConvert(options: ConvertCallbackOptions): FormatterCallbackResult\n\t{\n\t\treturn this[convertSymbol](options);\n\t}\n\n\tsetForChild(callback: (ForChildCallbackOptions) => FormatterCallbackResult)\n\t{\n\t\tif (Type.isFunction(callback))\n\t\t{\n\t\t\tthis[forChildSymbol] = callback;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis[forChildSymbol] = defaultElementConverter;\n\t\t}\n\t}\n\n\trunForChild(options: ForChildCallbackOptions): FormatterCallbackResult\n\t{\n\t\treturn this[forChildSymbol](options);\n\t}\n\n\tsetAfter(callback: (AfterCallbackOptions) => FormatterCallbackResult)\n\t{\n\t\tif (Type.isFunction(callback))\n\t\t{\n\t\t\tthis[afterSymbol] = callback;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis[afterSymbol] = defaultElementConverter;\n\t\t}\n\t}\n\n\trunAfter(options: AfterCallbackOptions): FormatterCallbackResult\n\t{\n\t\treturn this[afterSymbol](options);\n\t}\n\n\tsetFormatter(formatter: Formatter)\n\t{\n\t\tthis[formatterSymbol] = formatter;\n\t}\n\n\tgetFormatter(): Formatter\n\t{\n\t\treturn this[formatterSymbol];\n\t}\n}\n","import { Type } from 'main.core';\nimport { BBCodeFragmentNode, BBCodeNode, BBCodeScheme } from 'ui.bbcode.model';\nimport { BBCodeParser } from 'ui.bbcode.parser';\nimport { NodeFormatter, type BeforeConvertCallbackOptions } from './node-formatter';\n\nexport * from './node-formatter';\n\nexport type FormatterData = {\n\t[key: string]: any,\n};\n\nexport type UnknownNodeCallbackOptions = {\n\tnode: BBCodeNode,\n\tformatter: Formatter,\n\tdata: FormatterData,\n};\n\nexport type FormatterOptions = {\n\tformatters: Array<NodeFormatter>,\n\tonUnknown: (UnknownNodeCallbackOptions) => BBCodeNode | null,\n};\n\nexport type FormatterFormatOptions = {\n\tsource: BBCodeNode | string,\n\tdata?: FormatterData,\n};\n\nexport interface FormatterElement\n{\n\tappendChild(): void\n}\n\nconst formattersSymbol: Symbol = Symbol('formatters');\nconst onUnknownSymbol: Symbol = Symbol('onUnknown');\nconst dataSymbol: Symbol = Symbol('data');\n\n/**\n * @memberOf BX.UI.BBCode\n */\nexport class Formatter\n{\n\t[formattersSymbol]: Map<any, any> = new Map();\n\t[onUnknownSymbol]: (UnknownNodeCallbackOptions) => NodeFormatter | null = null;\n\t[dataSymbol]: FormatterData | null = null;\n\n\tconstructor(options: FormatterOptions = {})\n\t{\n\t\tthis.setNodeFormatters(options.formatters);\n\t\tif (Type.isNil(options.onUnknown))\n\t\t{\n\t\t\tthis.setOnUnknown(this.getDefaultUnknownNodeCallback());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.setOnUnknown(options.onUnknown);\n\t\t}\n\t}\n\n\tisElement(source): boolean\n\t{\n\t\treturn Type.isObject(source) && Type.isFunction(source.appendChild);\n\t}\n\n\tstatic prepareSourceNode(source: BBCodeNode | string): BBCodeNode | null\n\t{\n\t\tif (source instanceof BBCodeNode)\n\t\t{\n\t\t\treturn source;\n\t\t}\n\n\t\tif (Type.isString(source))\n\t\t{\n\t\t\treturn (new BBCodeParser()).parse(source);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tsetData(data: FormatterData)\n\t{\n\t\tthis[dataSymbol] = data;\n\t}\n\n\tgetData(): FormatterData\n\t{\n\t\treturn this[dataSymbol];\n\t}\n\n\tsetNodeFormatters(formatters: Array<NodeFormatter>)\n\t{\n\t\tif (Type.isArrayFilled(formatters))\n\t\t{\n\t\t\tformatters.forEach((formatter: NodeFormatter) => {\n\t\t\t\tthis.setNodeFormatter(formatter);\n\t\t\t});\n\t\t}\n\t}\n\n\tsetNodeFormatter(formatter: NodeFormatter)\n\t{\n\t\tif (formatter instanceof NodeFormatter)\n\t\t{\n\t\t\tthis[formattersSymbol].set(formatter.getName(), formatter);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new TypeError('formatter is not a NodeFormatter instance.');\n\t\t}\n\t}\n\n\tgetDefaultUnknownNodeCallback(): (UnknownNodeCallbackOptions) => NodeFormatter | null\n\t{\n\t\tthrow new TypeError('Must be implemented in subclass');\n\t}\n\n\tsetOnUnknown(callback: (UnknownNodeCallbackOptions) => NodeFormatter | null)\n\t{\n\t\tif (Type.isFunction(callback))\n\t\t{\n\t\t\tthis[onUnknownSymbol] = callback;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new TypeError('OnUnknown callback is not a function.');\n\t\t}\n\t}\n\n\trunOnUnknown(options: UnknownNodeCallbackOptions): NodeFormatter | null\n\t{\n\t\tconst result: NodeFormatter | null = this[onUnknownSymbol](options);\n\t\tif (result instanceof NodeFormatter || Type.isNull(result))\n\t\t{\n\t\t\treturn result;\n\t\t}\n\n\t\tthrow new TypeError('OnUnknown callback returned not NodeFormatter instance or null.');\n\t}\n\n\tgetNodeFormatter(node: BBCodeNode): NodeFormatter | null\n\t{\n\t\tconst formatter: ?NodeFormatter = this[formattersSymbol].get(node.getName());\n\t\tif (formatter instanceof NodeFormatter)\n\t\t{\n\t\t\treturn formatter;\n\t\t}\n\n\t\treturn this.runOnUnknown({ node, formatter: this });\n\t}\n\n\tgetNodeFormatters(): Array<NodeFormatter>\n\t{\n\t\treturn this[formattersSymbol];\n\t}\n\n\tformat(options: FormatterFormatOptions): DocumentFragment | HTMLElement | Text | null\n\t{\n\t\tif (!Type.isPlainObject(options))\n\t\t{\n\t\t\tthrow new TypeError('options is not a object');\n\t\t}\n\n\t\tconst { source, data = {} } = options;\n\t\tif (!Type.isUndefined(data) && !Type.isPlainObject(data))\n\t\t{\n\t\t\tthrow new TypeError('options.data is not a object');\n\t\t}\n\n\t\tthis.setData(data);\n\n\t\tconst sourceNode: ?BBCodeNode = Formatter.prepareSourceNode(source);\n\t\tif (Type.isNull(sourceNode))\n\t\t{\n\t\t\tthrow new TypeError('options.source is not a BBCodeNode or string');\n\t\t}\n\n\t\tconst nodeFormatter: NodeFormatter = this.getNodeFormatter(sourceNode);\n\t\tconst isValidNode: boolean = nodeFormatter.validate({\n\t\t\tnode: sourceNode,\n\t\t\tformatter: this,\n\t\t\tdata,\n\t\t});\n\t\tif (!isValidNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tconst preparedNode: ?BBCodeNode = nodeFormatter.runBefore({\n\t\t\tnode: sourceNode,\n\t\t\tformatter: this,\n\t\t\tdata,\n\t\t});\n\t\tif (Type.isNull(preparedNode))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tconst convertedElement: ?HTMLElement = nodeFormatter.runConvert({\n\t\t\tnode: preparedNode,\n\t\t\tformatter: this,\n\t\t\tdata,\n\t\t});\n\t\tif (Type.isNull(convertedElement))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpreparedNode.getChildren().forEach((childNode: BBCodeNode) => {\n\t\t\tconst childElement: ?HTMLElement = this.format({ source: childNode, data });\n\t\t\tif (childElement !== null)\n\t\t\t{\n\t\t\t\tconst convertedChildElement: ?HTMLElement = nodeFormatter.runForChild({\n\t\t\t\t\tnode: childNode,\n\t\t\t\t\telement: childElement,\n\t\t\t\t\tformatter: this,\n\t\t\t\t\tdata,\n\t\t\t\t});\n\n\t\t\t\tif (convertedChildElement !== null && this.isElement(convertedElement))\n\t\t\t\t{\n\t\t\t\t\tconvertedElement.appendChild(convertedChildElement);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn nodeFormatter.runAfter({\n\t\t\tnode: preparedNode,\n\t\t\telement: convertedElement,\n\t\t\tformatter: this,\n\t\t\tdata,\n\t\t});\n\t}\n}\n"],"names":["nameSymbol","Symbol","groupSymbol","validateSymbol","beforeSymbol","convertSymbol","forChildSymbol","afterSymbol","formatterSymbol","defaultValidator","defaultNodeConverter","node","defaultElementConverter","element","NodeFormatter","constructor","options","Type","isArray","name","setName","isNil","formatter","setFormatter","setValidate","validate","setBefore","before","setConvert","convert","setForChild","forChild","setAfter","after","isStringFilled","TypeError","getName","callback","isFunction","result","isBoolean","runBefore","runConvert","runForChild","runAfter","getFormatter","formattersSymbol","onUnknownSymbol","dataSymbol","Formatter","Map","setNodeFormatters","formatters","onUnknown","setOnUnknown","getDefaultUnknownNodeCallback","isElement","source","isObject","appendChild","prepareSourceNode","BBCodeNode","isString","BBCodeParser","parse","setData","data","getData","isArrayFilled","forEach","setNodeFormatter","set","runOnUnknown","isNull","getNodeFormatter","get","getNodeFormatters","format","isPlainObject","isUndefined","sourceNode","nodeFormatter","isValidNode","preparedNode","convertedElement","getChildren","childNode","childElement","convertedChildElement"],"mappings":";;;;;;CAoCA,MAAMA,UAAkB,GAAGC,MAAM,CAAC,MAAM,CAAC;CACzC,MAAMC,WAAmB,GAAGD,MAAM,CAAC,OAAO,CAAC;CAC3C,MAAME,cAAsB,GAAGF,MAAM,CAAC,UAAU,CAAC;CACjD,MAAMG,YAAoB,GAAGH,MAAM,CAAC,QAAQ,CAAC;CAC7C,MAAMI,aAAq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