@fastkit/vui-wysiwyg 8.3.5 → 8.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vui-wysiwyg.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ import { IconName, TextableControl, VuiService } from "@fastkit/vui";
|
|
|
12
12
|
import { OrderedListOptions } from "@tiptap/extension-ordered-list";
|
|
13
13
|
import { TextAlignOptions } from "@tiptap/extension-text-align";
|
|
14
14
|
import { Node as Node$1 } from "@tiptap/pm/model";
|
|
15
|
-
//#region src/
|
|
15
|
+
//#region src/schema.d.ts
|
|
16
16
|
declare const EDITOR_EVENTS: readonly ["beforeCreate", "create", "update", "selectionUpdate", "transaction", "focus", "blur", "destroy"];
|
|
17
17
|
type PrefixedEventName<S extends string> = `on${Capitalize<S>}`;
|
|
18
18
|
type WysiwygEditorEvent = (typeof EDITOR_EVENTS)[number];
|
package/dist/vui-wysiwyg.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { OrderedList } from "@tiptap/extension-ordered-list";
|
|
|
14
14
|
import { TextAlign } from "@tiptap/extension-text-align";
|
|
15
15
|
import { BubbleMenu } from "@tiptap/vue-3/menus";
|
|
16
16
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
17
|
-
//#region src/
|
|
17
|
+
//#region src/schema.ts
|
|
18
18
|
const EDITOR_EVENTS = [
|
|
19
19
|
"beforeCreate",
|
|
20
20
|
"create",
|
package/dist/vui-wysiwyg.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vui-wysiwyg.mjs","names":[],"sources":["../src/schemes.ts","../src/injections.ts","../src/extensions/linter/Linter.tsx","../src/extensions/linter/utils.ts","../src/extensions/linter/LinterPlugin.ts","../src/extensions/linter/plugins/BadWords.tsx","../src/extensions/linter/plugins/HeadingLevel.ts","../src/extensions/linter/plugins/Punctuation.ts","../src/extensions/color.ts","../src/extensions/custom-tag.ts","../src/tools/bullet-list.ts","../src/tools/format-bold.ts","../src/tools/format-italic.ts","../src/tools/format-underline.ts","../src/tools/history.ts","../src/tools/link.ts","../src/tools/ordered-list.ts","../src/tools/color.tsx","../src/tools/text-align.tsx","../src/tools/custom-tag.ts","../src/components/VWysiwygEditor/VWysiwygEditor.tsx"],"sourcesContent":["import { type VuiService, type IconName } from '@fastkit/vui';\nimport {\n type Editor,\n type Extensions,\n type Node,\n type Extension,\n type Mark,\n type AnyExtension,\n type EditorOptions,\n} from '@tiptap/vue-3';\nimport { VNodeChild } from 'vue';\n\nconst EDITOR_EVENTS = [\n 'beforeCreate',\n 'create',\n 'update',\n 'selectionUpdate',\n 'transaction',\n 'focus',\n 'blur',\n 'destroy',\n] as const;\n\ntype PrefixedEventName<S extends string> = `on${Capitalize<S>}`;\n\nconst prefixedEventName = <S extends string>(source: S): PrefixedEventName<S> =>\n `on${source.charAt(0).toUpperCase()}${source.slice(1)}` as any;\n\nexport type WysiwygEditorEvent = (typeof EDITOR_EVENTS)[number];\n\nexport type WysiwygEditorPrefixedEvent = PrefixedEventName<WysiwygEditorEvent>;\n\nexport interface WysiwygEditorEventsOptions extends Partial<\n Pick<EditorOptions, WysiwygEditorPrefixedEvent>\n> {}\n\nexport type WysiwygEditorEventsBucket = {\n [EV in WysiwygEditorEvent]: NonNullable<\n WysiwygEditorEventsOptions[PrefixedEventName<EV>]\n >[];\n};\n\nexport class WysiwygEditorInitializeContext {\n readonly listeners: WysiwygEditorEventsBucket = {} as any;\n\n private readonly _vui: () => VuiService;\n\n get vui() {\n return this._vui();\n }\n\n constructor(\n vuiGetter: () => VuiService,\n opts: WysiwygEditorEventsOptions = {},\n ) {\n this._vui = vuiGetter;\n\n EDITOR_EVENTS.forEach((event) => {\n this.listeners[event] = [];\n const prefixed = prefixedEventName(event);\n const fn = opts[prefixed];\n fn && this.listeners[event].push(fn as any);\n });\n }\n\n on<EV extends WysiwygEditorEvent>(\n ev: EV,\n handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>,\n ) {\n this.listeners[ev].push(handler);\n return () => this.off(ev, handler);\n }\n\n off<EV extends WysiwygEditorEvent>(\n ev: EV,\n handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>,\n ) {\n this.listeners[ev] = this.listeners[ev].filter(\n (_handler) => _handler !== handler,\n ) as any;\n }\n\n editorOptions() {\n const opts: WysiwygEditorEventsOptions = {};\n\n EDITOR_EVENTS.forEach((event) => {\n const prefixed = prefixedEventName(event);\n opts[prefixed] = (props) => {\n const handlers = this.listeners[event];\n handlers.forEach((handler) => {\n handler(props as any);\n });\n };\n });\n\n return opts;\n }\n}\n\nexport interface WysiwygEditorContext {\n editor: Editor;\n vui: VuiService;\n}\n\nexport type WysiwygExtensionFactory<Options = any, Storage = any> = (\n ctx: WysiwygEditorInitializeContext,\n) =>\n Extension<Options, Storage> | Node<Options, Storage> | Mark<Options, Storage>;\n\nexport interface CreatedWysiwygExtension<Options = any, Storage = any> {\n __isCreatedWysiwygExtension: true;\n _configs: Partial<Options>[];\n configure(\n options?: Partial<Options>,\n ): CreatedWysiwygExtension<Options, Storage>;\n raw: WysiwygExtensionSource<Options, Storage>;\n}\n\nexport type WysiwygExtensionSource<Options = any, Storage = any> =\n | Extension<Options, Storage>\n | Node<Options, Storage>\n | Mark<Options, Storage>\n | WysiwygExtensionFactory<Options, Storage>;\n\nexport type RawWysiwygExtension<Options = any, Storage = any> =\n | WysiwygExtensionSource<Options, Storage>\n | CreatedWysiwygExtension<Options, Storage>;\n\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// extension: Extension<Options, Storage>,\n// ): Extension<Options, Storage>;\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// node: Node<Options, Storage>,\n// ): Node<Options, Storage>;\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// mark: Mark<Options, Storage>,\n// ): Mark<Options, Storage>;\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// factory: WysiwygExtensionFactory<Options, Storage>,\n// ): WysiwygExtensionFactory<Options, Storage>;\n\nfunction isCreatedWysiwygExtension<Options = any, Storage = any>(\n source: unknown,\n): source is CreatedWysiwygExtension<Options, Storage> {\n return (\n !!source &&\n typeof source === 'object' &&\n (source as CreatedWysiwygExtension).__isCreatedWysiwygExtension === true\n );\n}\n\nexport function createWysiwygExtension<Options = any, Storage = any>(\n extension: WysiwygExtensionSource<Options, Storage>,\n) {\n const ext: CreatedWysiwygExtension<Options, Storage> = {\n __isCreatedWysiwygExtension: true,\n _configs: [],\n configure: (opts) => {\n opts && ext._configs.push(opts);\n return ext;\n },\n raw: extension,\n };\n return ext;\n}\n\nfunction resolveRawWysiwygExtension(\n raw: RawWysiwygExtension,\n ctx: WysiwygEditorInitializeContext,\n): AnyExtension {\n if (isCreatedWysiwygExtension(raw)) {\n const { raw: _raw, _configs } = raw;\n let ext = typeof _raw === 'function' ? _raw(ctx) : _raw;\n _configs.forEach((config) => {\n ext = ext.configure(config);\n });\n return ext;\n }\n return typeof raw === 'function' ? raw(ctx) : raw;\n}\n\nexport function resolveRawWysiwygExtensions(\n raws: RawWysiwygExtension[],\n ctx: WysiwygEditorInitializeContext,\n) {\n return raws.map((raw) => resolveRawWysiwygExtension(raw, ctx));\n}\n\nexport type WysiwygEditorToolIcon =\n | IconName\n | ((ctx: WysiwygEditorContext) => IconName | (() => VNodeChild) | undefined);\n\n/**\n * Tool Configuration\n */\nexport interface WysiwygEditorTool {\n /**\n * Tool Key\n *\n * Must be unique to identify the tool\n */\n key: string;\n /** Icons to be displayed on the toolbar */\n icon: WysiwygEditorToolIcon;\n /** Conditions for displaying the icon as active */\n active?: boolean | ((ctx: WysiwygEditorContext) => boolean);\n /** Conditions for deactivating the icon */\n disabled?: boolean | ((ctx: WysiwygEditorContext) => boolean);\n /** Handler when mark text is clicked */\n onClick: (ctx: WysiwygEditorContext, ev: PointerEvent) => any;\n /** Whether to display tools in floating menu or not */\n floating?: boolean;\n /** Extensions that the tool depends on */\n extensions?: Extensions;\n}\n\nexport type WysiwygEditorToolFactory<Options = void> = (\n vui: VuiService,\n options?: Options,\n) => WysiwygEditorTool | WysiwygEditorTool[];\n\nexport type RawWysiwygEditorTool =\n WysiwygEditorTool | WysiwygEditorToolFactory<any>;\n\nfunction resolveRawWysiwygEditorTool(\n raw: RawWysiwygEditorTool,\n vui: VuiService,\n) {\n return typeof raw === 'function' ? raw(vui) : raw;\n}\n\nexport interface ResolvedWysiwygEditorSettings {\n tools: WysiwygEditorTool[];\n extensions: Extensions;\n}\n\nexport function resolveRawWysiwygEditorTools(\n rawTools: RawWysiwygEditorTool[],\n vui: VuiService,\n): ResolvedWysiwygEditorSettings {\n const tools: WysiwygEditorTool[] = [];\n const extensions: Extensions = [];\n\n rawTools.forEach((raw) => {\n let resolved = resolveRawWysiwygEditorTool(raw, vui);\n if (!Array.isArray(resolved)) {\n resolved = [resolved];\n }\n resolved.forEach((tool) => {\n tools.push(tool);\n if (tool.extensions) {\n extensions.push(...tool.extensions);\n }\n });\n });\n\n return {\n tools,\n extensions,\n };\n}\n","export const VUI_WYSIWYG_EDITOR_SYMBOL = 'vui-wysiwyg-editor';\n","import './Linter.scss';\n\nimport { Extension } from '@tiptap/vue-3';\nimport { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view';\nimport { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state';\nimport { Node as ProsemirrorNode } from '@tiptap/pm/model';\nimport {\n WysiwygLinterPlugin,\n WysiwygLinterResult as Issue,\n WysiwygLinterFixMessage,\n} from './LinterPlugin';\nimport { createWysiwygExtension } from '../../schemes';\n\nconst PROBLEM_CLASS_NAME = 'v-linter__problem';\nconst ISSUE_ICON_CLASS_NAME = 'v-linter__issue-icon';\nconst ISSUE_DATASET_NAME = 'data-issue-id';\n\nfunction resolveWysiwygLinterFixMessage(message: WysiwygLinterFixMessage) {\n return typeof message === 'function' ? message() : message;\n}\n\nfunction renderIcon(view: EditorView, issue: Issue) {\n const { level = 'warning' } = issue;\n const icon = document.createElement('div');\n const message = resolveWysiwygLinterFixMessage(issue.message);\n\n icon.className = `${ISSUE_ICON_CLASS_NAME} ${level}-scope`;\n icon.setAttribute(ISSUE_DATASET_NAME, issue.id);\n\n if (typeof message === 'string') {\n icon.title = message;\n }\n\n return icon;\n}\n\nfunction runAllLinterPlugins(\n doc: ProsemirrorNode,\n plugins: Array<typeof WysiwygLinterPlugin>,\n) {\n const decorations: [any?] = [];\n\n const issues = plugins\n .map((RegisteredLinterPlugin) =>\n new RegisteredLinterPlugin(doc).scan().getResults(),\n )\n .flat();\n\n issues.forEach((issue) => {\n const { level = 'warning', icon } = issue;\n const message = resolveWysiwygLinterFixMessage(issue.message);\n decorations.push(\n Decoration.inline(issue.from, issue.to, {\n class: `${PROBLEM_CLASS_NAME} ${level}-scope`,\n 'data-issue-id': issue.id,\n title: typeof message === 'string' ? message : undefined,\n }),\n );\n if (icon) {\n decorations.push(\n Decoration.widget(issue.from, (view) => renderIcon(view, issue)),\n );\n }\n });\n\n const decorationSet = DecorationSet.create(doc, decorations);\n\n return {\n issues,\n decorationSet,\n };\n}\n\nexport interface WysiwygLinterOptions {\n plugins: Array<typeof WysiwygLinterPlugin>;\n}\n\nexport interface WysiwygLinterStorage {\n issues: Issue[];\n}\n\nexport const WysiwygLinter = createWysiwygExtension((ctx) => {\n function showMenu(view: EditorView, issue: Issue, event: Event) {\n const message = resolveWysiwygLinterFixMessage(issue.message);\n const variant = ctx.vui.setting('containedVariant');\n const scope = ctx.vui.setting(`${issue.level}Scope`);\n\n return ctx.vui.menu({\n activator: event,\n content: (stack) => (\n <div class=\"v-linter__issue-menu__body\">\n <div\n class={[\n 'v-linter__issue-menu__message',\n `${scope}-scope ${variant}`,\n ]}>\n {message}\n </div>\n {issue.fix.length && (\n <div class=\"v-linter__issue-menu__fixers\">\n {issue.fix.map((fixer, index) => (\n <div key={index} class=\"v-linter__issue-menu__fixer\">\n <button\n type=\"button\"\n class=\"v-linter__issue-menu__fixer__button\"\n onClick={() => {\n stack.close();\n fixer.handler(view, issue);\n }}>\n <span class=\"v-linter__issue-menu__fixer__button__message\">\n {resolveWysiwygLinterFixMessage(fixer.message)}\n </span>\n </button>\n </div>\n ))}\n </div>\n )}\n </div>\n ),\n });\n }\n\n return Extension.create<WysiwygLinterOptions, WysiwygLinterStorage>({\n name: 'linter',\n\n addOptions() {\n return {\n plugins: [],\n };\n },\n addStorage() {\n return {\n issues: [],\n };\n },\n addProseMirrorPlugins() {\n const { plugins } = this.options;\n const { storage } = this;\n\n const runAll = (doc: ProsemirrorNode) => {\n const { issues, decorationSet } = runAllLinterPlugins(doc, plugins);\n storage.issues = issues;\n return decorationSet;\n };\n\n const getIssue = (id: string) =>\n storage.issues.find((issue) => issue.id === id);\n\n const getIssueElementByEvent = (\n source: EventTarget | null,\n ):\n | {\n issue: Issue;\n }\n | undefined => {\n if (!source || !(source instanceof HTMLElement)) {\n return;\n }\n const issueId = source.getAttribute(ISSUE_DATASET_NAME);\n const issue = issueId && getIssue(issueId);\n if (!issue) return;\n\n return {\n issue,\n };\n };\n\n const linterPlugin: Plugin<any> = new Plugin({\n key: new PluginKey('linter'),\n state: {\n init(_, { doc }) {\n return runAll(doc);\n },\n apply(transaction, oldState) {\n return transaction.docChanged ? runAll(transaction.doc) : oldState;\n },\n },\n props: {\n decorations(state) {\n return linterPlugin.getState(state);\n },\n handleClick(view, _, event) {\n const info = getIssueElementByEvent(event.target);\n if (!info) {\n return false;\n }\n\n const { issue } = info;\n const { from, to } = issue;\n\n const focus = () =>\n view.dispatch(\n view.state.tr\n .setSelection(TextSelection.create(view.state.doc, from, to))\n .scrollIntoView(),\n );\n\n focus();\n\n showMenu(view, issue, event);\n return true;\n },\n },\n });\n\n return [linterPlugin];\n },\n });\n});\n","let IDX = 256;\nlet BUFFER: any;\nconst HEX: any = [];\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nexport function cheepUUID() {\n let i = 0;\n let num;\n let out = '';\n\n if (!BUFFER || IDX + 16 > 256) {\n BUFFER = Array((i = 256));\n while (i--) BUFFER[i] = (256 * Math.random()) | 0;\n\n i = IDX = 0;\n }\n\n for (; i < 16; i++) {\n num = BUFFER[IDX + i];\n if (i == 6) out += HEX[(num & 15) | 64];\n else if (i == 8) out += HEX[(num & 63) | 128];\n else out += HEX[num];\n\n if (i & 1 && i > 1 && i < 11) out += '-';\n }\n\n IDX++;\n return out;\n}\n","import { VNodeChild } from 'vue';\nimport { Node as ProsemirrorNode } from '@tiptap/pm/model';\nimport { EditorView } from '@tiptap/pm/view';\nimport { cheepUUID } from './utils';\n\nexport type WysiwygLinterFixFn = (\n view: EditorView,\n issue: WysiwygLinterResult,\n) => any;\n\nexport type WysiwygLinterFixMessage = string | (() => VNodeChild);\n\nexport interface WysiwygLinterFixer {\n message: WysiwygLinterFixMessage;\n handler: WysiwygLinterFixFn;\n}\n\nexport type WysiwygLinterResultLevel = 'warning' | 'error';\n\n// fixers\nexport interface WysiwygLinterResult {\n id: string;\n icon: boolean;\n level: WysiwygLinterResultLevel;\n message: WysiwygLinterFixMessage;\n from: number;\n to: number;\n fix: WysiwygLinterFixer[];\n}\n\nexport interface RawLinterResult extends Omit<\n WysiwygLinterResult,\n 'level' | 'fix' | 'id' | 'icon'\n> {\n level?: WysiwygLinterResultLevel;\n icon?: boolean;\n fix?: WysiwygLinterFixer | WysiwygLinterFixer[];\n}\n\nexport class WysiwygLinterPlugin {\n protected doc: ProsemirrorNode;\n\n private results: Array<WysiwygLinterResult> = [];\n\n constructor(doc: ProsemirrorNode) {\n this.doc = doc;\n }\n\n record(result: RawLinterResult) {\n const { fix = [], icon = false } = result;\n this.results.push({\n level: 'error',\n id: cheepUUID(),\n ...result,\n fix: Array.isArray(fix) ? fix : [fix],\n icon,\n });\n }\n\n scan() {\n return this;\n }\n\n getResults() {\n return this.results;\n }\n}\n","import { WysiwygLinterPlugin } from '../LinterPlugin';\n\nexport function WysiwygLinterBadWords(\n words: string[],\n): typeof WysiwygLinterPlugin {\n const regex = new RegExp(`\\\\b(${words.join('|')})\\\\b`);\n\n return class WysiwygLinterBadWords extends WysiwygLinterPlugin {\n scan() {\n this.doc.descendants((node: any, position: number) => {\n if (!node.isText) {\n return;\n }\n\n const matches = regex.exec(node.text);\n\n if (matches) {\n const fixValue = `${matches[0]}!!!!!`;\n\n this.record({\n level: 'warning',\n message: `Try not to say '${matches[0]}'`,\n from: position + matches.index,\n to: position + matches.index + matches[0].length,\n fix: [\n {\n message: () => (\n <span>\n <code>{fixValue}</code>に修正する。\n </span>\n ),\n handler: () => {\n // eslint-disable-next-line no-console\n console.log('hoge');\n },\n },\n {\n message: 'どうにかする',\n handler: () => {\n // eslint-disable-next-line no-console\n console.log('hoge');\n },\n },\n ],\n });\n }\n });\n\n return this;\n }\n };\n}\n","import { EditorView } from '@tiptap/pm/view';\nimport {\n WysiwygLinterPlugin,\n WysiwygLinterResult as Issue,\n} from '../LinterPlugin';\n\nexport class WysiwygLinterHeadingLevel extends WysiwygLinterPlugin {\n fixHeader(level: number) {\n return function ({ state, dispatch }: EditorView, issue: Issue) {\n dispatch(state.tr.setNodeMarkup(issue.from - 1, undefined, { level }));\n };\n }\n\n scan() {\n let lastHeadLevel: number | null = null;\n\n this.doc.descendants((node, position) => {\n if (node.type.name === 'heading') {\n // Check whether heading levels fit under the current level\n const { level } = node.attrs;\n\n if (lastHeadLevel != null && level > lastHeadLevel + 1) {\n this.record({\n message: `Heading too small (${level} under ${lastHeadLevel})`,\n from: position + 1,\n to: position + 1 + node.content.size,\n fix: {\n message: '修正する',\n handler: this.fixHeader(lastHeadLevel + 1),\n },\n });\n }\n lastHeadLevel = level;\n }\n });\n\n return this;\n }\n}\n","import { EditorView } from '@tiptap/pm/view';\nimport {\n WysiwygLinterPlugin,\n WysiwygLinterResult as Issue,\n} from '../LinterPlugin';\n\nexport class WysiwygLinterPunctuation extends WysiwygLinterPlugin {\n public regex = / ([,.!?:]) ?/g;\n\n fix(replacement: any) {\n return function ({ state, dispatch }: EditorView, issue: Issue) {\n dispatch(\n state.tr.replaceWith(\n issue.from,\n issue.to,\n state.schema.text(replacement),\n ),\n );\n };\n }\n\n scan() {\n this.doc.descendants((node, position) => {\n if (!node.isText) {\n return;\n }\n\n if (!node.text) {\n return;\n }\n\n const matches = this.regex.exec(node.text);\n\n if (matches) {\n this.record({\n message: 'Suspicious spacing around punctuation',\n from: position + matches.index,\n to: position + matches.index + matches[0].length,\n fix: {\n message: 'Fix it!!!',\n handler: this.fix(`${matches[1]} `),\n },\n });\n }\n });\n\n return this;\n }\n}\n","import { Extension } from '@tiptap/vue-3';\nimport '@tiptap/extension-text-style';\n\nexport type WysiwygColorOptions = {\n types: string[];\n};\n\ndeclare module '@tiptap/vue-3' {\n interface Commands<ReturnType> {\n color: {\n /**\n * Set the text color\n */\n setColor: (color: string) => ReturnType;\n /**\n * Unset the text color\n */\n unsetColor: () => ReturnType;\n };\n }\n}\n\nexport const WysiwygColorExtension = Extension.create<WysiwygColorOptions>({\n name: 'color',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n color: {\n default: null,\n parseHTML: (element) => element.style.color.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.color) {\n return {};\n }\n\n return {\n style: `color: ${attributes.color}`,\n };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setColor:\n (color) =>\n ({ chain }) =>\n chain().setMark('textStyle', { color }).run(),\n unsetColor:\n () =>\n ({ chain }) =>\n chain()\n .setMark('textStyle', { color: null })\n .removeEmptyTextStyle()\n .run(),\n };\n },\n});\n","import { Extension, mergeAttributes, Mark } from '@tiptap/vue-3';\nimport '@tiptap/extension-text-style';\n// import '@tiptap/vue-3';\n\nexport type WysiwygCustomTagSettings = {\n /**\n * tag name\n *\n * Either the html default tag name or a custom tag name is acceptable\n *\n * @default \"span\"\n */\n tag: string;\n\n /**\n * HTML Attributes\n *\n * Attributes to be assigned to tags such as `class`, `data-xxx`, etc.\n */\n attrs?: Record<any, string>;\n};\n\ndeclare module '@tiptap/vue-3' {\n interface Commands<ReturnType> {\n customTag: {\n /**\n * Set the custom tag\n */\n setCustomTag: (markName: string) => ReturnType;\n /**\n * Toggle the custom tag\n */\n toggleCustomTag: (markName: string) => ReturnType;\n /**\n * Unset the custom tag\n */\n unsetCustomTag: (markName: string) => ReturnType;\n };\n }\n}\n\n// export type WysiwygCustomTagSettings = WysiwygCustomTagOptions & {\n// /**\n// * extension name\n// */\n// name: string;\n// };\n\nexport function createWysiwygCustomTagMark(\n name: string,\n settings: Partial<WysiwygCustomTagSettings>,\n) {\n const { tag = 'span', attrs } = settings;\n const attrEntries = attrs && Object.entries(attrs);\n const attrNames = attrEntries && attrEntries.map(([name]) => name);\n\n const getElementAttrs = (\n el: HTMLElement,\n ): Record<any, string> | undefined => {\n if (!attrNames) return;\n\n return el\n .getAttributeNames()\n\n .reduce((acc, name) => ({ ...acc, [name]: el.getAttribute(name) }), {});\n };\n\n const isMatchedElementAttrs = (elAttrs: Record<any, string>): boolean => {\n if (!attrEntries) return true;\n\n return attrEntries.every(([name, value]) => elAttrs[name] === value);\n };\n\n return Mark.create<WysiwygCustomTagSettings>({\n name,\n\n addOptions() {\n return {\n tag,\n attrs: attrs && { ...attrs },\n };\n },\n parseHTML() {\n return [\n {\n tag,\n getAttrs: (el: any) => {\n if (!attrs) return null;\n const elAttrs = getElementAttrs(el);\n if (!elAttrs) return false;\n return isMatchedElementAttrs(el) && null;\n },\n },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\n tag,\n attrs ? mergeAttributes(attrs, HTMLAttributes) : HTMLAttributes,\n 0,\n ];\n },\n });\n}\n\nexport const WysiwygCustomTagExtension =\n Extension.create<WysiwygCustomTagSettings>({\n name: 'custom-tag',\n addCommands() {\n return {\n setCustomTag:\n (markName) =>\n ({ chain }) =>\n chain().setMark(markName).run(),\n unsetCustomTag:\n (markName) =>\n ({ chain }) =>\n chain().unsetMark(markName).run(),\n toggleCustomTag:\n (markName) =>\n ({ chain }) =>\n chain().toggleMark(markName).run(),\n };\n },\n });\n","import { BulletList, BulletListOptions } from '@tiptap/extension-bullet-list';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygBulletListTool: WysiwygEditorToolFactory<\n BulletListOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'bulletList',\n icon: vui.icon('editorformatListBulleted'),\n active: ({ editor }) => editor.isActive('bulletList'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleBulletList().run();\n },\n floating: true,\n extensions: [BulletList.configure(options)],\n };\n return tool;\n};\n","import { Bold, BoldOptions } from '@tiptap/extension-bold';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygFormatBoldTool: WysiwygEditorToolFactory<BoldOptions> = (\n vui,\n options,\n) => {\n const tool: WysiwygEditorTool = {\n key: 'formatBold',\n icon: vui.icon('editorformatBold'),\n active: ({ editor }) => editor.isActive('bold'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleBold().run();\n },\n floating: true,\n extensions: [Bold.configure(options)],\n };\n return tool;\n};\n","import { Italic, ItalicOptions } from '@tiptap/extension-italic';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygFormatItalicTool: WysiwygEditorToolFactory<\n ItalicOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'formatItalic',\n icon: vui.icon('editorformatItalic'),\n active: ({ editor }) => editor.isActive('italic'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleItalic().run();\n },\n floating: true,\n extensions: [Italic.configure(options)],\n };\n return tool;\n};\n","import { Underline, UnderlineOptions } from '@tiptap/extension-underline';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygFormatUnderlineTool: WysiwygEditorToolFactory<\n UnderlineOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'formatUnderline',\n icon: vui.icon('editorformatUnderline'),\n active: ({ editor }) => editor.isActive('underline'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleUnderline().run();\n },\n floating: true,\n extensions: [Underline.configure(options)],\n };\n return tool;\n};\n","import { History, HistoryOptions } from '@tiptap/extension-history';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygHistoryTool: WysiwygEditorToolFactory<HistoryOptions> = (\n vui,\n options,\n) => {\n const undo: WysiwygEditorTool = {\n key: 'history-undo',\n icon: vui.icon('editorUndo'),\n disabled: ({ editor }) => !editor.can().undo(),\n onClick: ({ editor }) => {\n editor.chain().focus().undo().run();\n },\n extensions: [History.configure(options)],\n };\n const redo: WysiwygEditorTool = {\n key: 'history-redo',\n icon: vui.icon('editorRedo'),\n disabled: ({ editor }) => !editor.can().redo(),\n onClick: ({ editor }) => {\n editor.chain().focus().redo().run();\n },\n };\n return [undo, redo];\n};\n","import { Link, LinkOptions } from '@tiptap/extension-link';\nimport { validateIf, url } from '@fastkit/vui';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygLinkTool: WysiwygEditorToolFactory<LinkOptions> = (\n vui,\n options,\n) => {\n const tool: WysiwygEditorTool = {\n key: 'link',\n icon: vui.icon('editorLink'),\n active: ({ editor }) => editor.isActive('link'),\n onClick: async ({ vui, editor }) => {\n const { href = '' } = editor.getAttributes('link');\n const result = await vui.prompt({\n input: {\n label: 'Link URL',\n rules: [validateIf, url],\n initialValue: href,\n size: 'sm',\n autofocus: true,\n },\n });\n\n if (result === undefined || result === false) {\n return;\n }\n\n const range = editor.chain().focus().extendMarkRange('link');\n\n if (!result) {\n range.unsetLink().run();\n } else {\n range\n .setLink({\n href: result,\n })\n .run();\n }\n },\n floating: true,\n extensions: [\n Link.configure({\n openOnClick: false,\n ...options,\n }),\n ],\n };\n return tool;\n};\n","import {\n OrderedList,\n OrderedListOptions,\n} from '@tiptap/extension-ordered-list';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport const WysiwygOrderedListTool: WysiwygEditorToolFactory<\n OrderedListOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'orderedList',\n icon: vui.icon('editorformatListNumbered'),\n active: ({ editor }) => editor.isActive('orderedList'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleOrderedList().run();\n },\n floating: true,\n extensions: [OrderedList.configure(options)],\n };\n return tool;\n};\n","import './color.scss';\n\nimport { VNodeChild } from 'vue';\nimport { type VuiService, VIcon } from '@fastkit/vui';\nimport { TextStyle } from '@tiptap/extension-text-style';\nimport { WysiwygColorExtension } from '../extensions';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\nexport interface WysiwygColorItem {\n key?: string | number;\n name?: VNodeChild | ((vui: VuiService) => VNodeChild);\n color: string | null;\n}\n\nexport interface CreateWysiwygColorToolOptions {\n items: WysiwygColorItem[];\n withLabel?: boolean;\n}\n\nexport function createWysiwygColorTool(opts: CreateWysiwygColorToolOptions) {\n const WysiwygColorTool: WysiwygEditorToolFactory = (vui) => {\n const tool: WysiwygEditorTool = {\n key: 'textColor',\n // active: ({ editor }) => editor.isActive('textStyle'),\n icon:\n ({ editor }) =>\n () => {\n const { color } = editor.getAttributes('textStyle');\n const style = { color };\n return (\n <span class=\"v-wysiwyg-color-tool__button\">\n <VIcon\n class=\"v-wysiwyg-color-tool__button__icon\"\n name={vui.icon('editorTextColor')}\n />\n <span class=\"v-wysiwyg-color-tool__button__bar\" style={style} />\n </span>\n );\n },\n onClick: (ctx, ev) => {\n ctx.vui.menu({\n class: 'v-wysiwyg-color-tool__menu',\n activator: ev,\n content: (stack) => (\n <div\n class={[\n 'v-wysiwyg-color-tool__items',\n { 'v-wysiwyg-color-tool__items--with-label': opts.withLabel },\n ]}>\n {opts.items.map((item, index) => (\n <button\n key={item.key == null ? index : item.key}\n class=\"v-wysiwyg-color-tool__item\"\n type=\"button\"\n onClick={() => {\n const { color } = item;\n let command = ctx.editor.chain().focus();\n if (color) {\n command = command.setColor(color);\n } else {\n command = command.unsetColor();\n }\n command.run();\n stack.close();\n }}>\n <span\n class=\"v-wysiwyg-color-tool__item__color\"\n style={item.color ? { color: item.color } : {}}\n />\n {opts.withLabel && (\n <span class=\"v-wysiwyg-color-tool__item__name\">\n {item.name}\n </span>\n )}\n </button>\n ))}\n </div>\n ),\n });\n },\n floating: true,\n extensions: [TextStyle, WysiwygColorExtension],\n };\n return tool;\n };\n\n return WysiwygColorTool;\n}\n","import { TextAlign, TextAlignOptions } from '@tiptap/extension-text-align';\nimport { type Editor } from '@tiptap/vue-3';\nimport { VuiServiceIconSettings, VButtonGroup, VButton } from '@fastkit/vui';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\n\n/**\n * A list of available options for the text align attribute.\n * @remarks\n * `\"justify\"` has not yet been adopted because of ambiguity in browser support.\n */\nexport const WYSIWYG_TEXT_ALIGN_VALUES = [\n 'left',\n 'center',\n 'right',\n // 'justify',\n] as const;\n\n/** Text align value */\nexport type WysiwygTextAlignValue = (typeof WYSIWYG_TEXT_ALIGN_VALUES)[number];\n\n/**\n * A list of nodes where the text align attribute should be applied to.\n */\nconst DEFAULT_TYPES = ['heading', 'paragraph'] as const;\n\nexport interface WysiwygTextAlignOptions {\n /**\n * A list of nodes where the text align attribute should be applied to. Usually something like `['heading', 'paragraph']`\n * @default DEFAULT_TYPES\n * @see {@link DEFAULT_TYPES}\n */\n types?: TextAlignOptions['types'];\n /**\n * A list of available options for the text align attribute.\n * @default WYSIWYG_TEXT_ALIGN_VALUES\n * @see {@link WYSIWYG_TEXT_ALIGN_VALUES}\n */\n alignments?: WysiwygTextAlignValue[];\n /**\n * The default text align.\n * @default left\n */\n defaultAlignment: WysiwygTextAlignValue;\n}\n\nconst conditions = WYSIWYG_TEXT_ALIGN_VALUES.map<\n [WysiwygTextAlignValue, { textAlign: WysiwygTextAlignValue }]\n>((value) => [value, { textAlign: value }]);\n\nconst ICON_AT: Record<WysiwygTextAlignValue, keyof VuiServiceIconSettings> = {\n left: 'editorAlignLeft',\n center: 'editorAlignCenter',\n right: 'editorAlignRight',\n};\n\nfunction resolveOptions(\n rawOptions: Partial<WysiwygTextAlignOptions> | undefined,\n): Required<WysiwygTextAlignOptions> {\n const types = rawOptions?.types || DEFAULT_TYPES.slice();\n const alignments =\n rawOptions?.alignments || WYSIWYG_TEXT_ALIGN_VALUES.slice();\n const defaultAlignment = rawOptions?.defaultAlignment || 'left';\n\n return {\n types,\n alignments,\n defaultAlignment,\n };\n}\nfunction getCurrentAlign(\n editor: Editor,\n options: WysiwygTextAlignOptions,\n): WysiwygTextAlignValue {\n for (const [align, condition] of conditions) {\n if (editor.isActive(condition)) return align;\n }\n return options.defaultAlignment;\n}\n\nexport const WysiwygTextAlignTool: WysiwygEditorToolFactory<\n WysiwygTextAlignOptions\n> = (vui, options) => {\n const resolvedOptions = resolveOptions(options);\n const { alignments } = resolvedOptions;\n\n const getIcon = (value: WysiwygTextAlignValue) => {\n const iconKey = ICON_AT[value];\n const icon = vui.icon(iconKey);\n if (icon === '$empty' || typeof icon === 'function') return;\n return icon;\n };\n\n const variant = vui.setting('plainVariant');\n const toolButtonActiveColor = vui.setting('primaryScope');\n\n const tool: WysiwygEditorTool = {\n key: 'textAlign',\n icon: ({ editor }) => getIcon(getCurrentAlign(editor, resolvedOptions)),\n onClick: async ({ vui, editor }, ev) => {\n vui.menu({\n distance: 0,\n activator: ev,\n content: (menu) => (\n <VButtonGroup variant={variant}>\n {alignments.map((value) => {\n const isActive = editor.isActive({ textAlign: value });\n return (\n <VButton\n tabindex={-1}\n color={isActive ? toolButtonActiveColor : undefined}\n key={value}\n icon={getIcon(value)}\n onClick={() => {\n editor.chain().focus().setTextAlign(value).run();\n }}\n />\n );\n })}\n </VButtonGroup>\n ),\n });\n },\n floating: true,\n extensions: [TextAlign.configure(resolvedOptions)],\n };\n return tool;\n};\n","import { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schemes';\nimport {\n createWysiwygCustomTagMark,\n WysiwygCustomTagSettings,\n WysiwygCustomTagExtension,\n} from '../extensions/custom-tag';\n\nexport interface WysiwygCustomTagToolSettings\n extends\n Pick<WysiwygEditorTool, 'icon' | 'floating'>,\n Partial<WysiwygCustomTagSettings> {}\n\n/**\n * Generate Custom Tag Tool\n *\n * @param markName - Mark name\n * @param settings - Tool Configuration\n * @returns Generated Tool\n */\nexport function createWysiwygCustomTagTool(\n markName: string,\n settings: WysiwygCustomTagToolSettings,\n): WysiwygEditorToolFactory {\n const Mark = createWysiwygCustomTagMark(markName, settings);\n const { icon, floating = true } = settings;\n\n return (vui) => {\n const tool: WysiwygEditorTool = {\n key: `customTag:${markName}`,\n icon,\n floating,\n active: ({ editor }) => editor.isActive(markName),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleCustomTag(markName).run();\n },\n extensions: [WysiwygCustomTagExtension, Mark.configure(settings)],\n };\n return tool;\n };\n}\n","import './VWysiwygEditor.scss';\nimport {\n defineComponent,\n PropType,\n computed,\n ref,\n watch,\n onBeforeUnmount,\n VNodeChild,\n} from 'vue';\nimport {\n createFormNodeWrapperProps,\n FormNodeWrapperSlots,\n VFormControl,\n VControlField,\n createControlFieldProps,\n InputBoxSlots,\n IconName,\n createTextableProps,\n createTextableEmits,\n TextableControl,\n createControlProps,\n useControl,\n createControlFieldProviderProps,\n useControlField,\n VTextCounter,\n defineSlots,\n useVui,\n VButton,\n VButtonGroup,\n withCtx,\n} from '@fastkit/vui';\nimport {\n EditorContent,\n useEditor,\n FocusPosition,\n type Editor,\n} from '@tiptap/vue-3';\nimport { BubbleMenu } from '@tiptap/vue-3/menus';\nimport { StarterKit } from '@tiptap/starter-kit';\nimport { VUI_WYSIWYG_EDITOR_SYMBOL } from '../../injections';\nimport {\n RawWysiwygExtension,\n resolveRawWysiwygExtensions,\n RawWysiwygEditorTool,\n resolveRawWysiwygEditorTools,\n WysiwygEditorContext,\n // EditorEventsOptions,\n WysiwygEditorInitializeContext,\n} from '../../schemes';\n\nconst slots = defineSlots<FormNodeWrapperSlots & InputBoxSlots>();\n\nexport interface VWysiwygEditorAPI {\n readonly editor: Editor | undefined;\n readonly control: TextableControl;\n}\n\nexport const VWysiwygEditor = defineComponent({\n name: 'VWysiwygEditor',\n props: {\n ...createTextableProps(),\n ...createFormNodeWrapperProps(),\n ...createControlFieldProps(),\n ...createControlFieldProviderProps(),\n ...createControlProps(),\n ...slots(),\n extensions: {\n type: Array as PropType<RawWysiwygExtension[]>,\n default: () => [],\n },\n tools: {\n type: Array as PropType<RawWysiwygEditorTool[]>,\n default: () => [],\n },\n floatingToolbar: Boolean,\n disabledMinHeight: Boolean,\n disabledMaxHeight: Boolean,\n removeDefaultWrapper: {\n type: Boolean,\n default: true,\n },\n },\n emits: {\n ...createTextableEmits(),\n },\n slots,\n setup(props, ctx) {\n const vui = useVui();\n\n const textRef = ref('');\n const toolButtonActiveColor = vui.setting('primaryScope');\n\n const wysiwygSettings = computed(() =>\n resolveRawWysiwygEditorTools(props.tools, vui),\n );\n\n const control = useControl(props);\n useControlField(props);\n\n const classes = computed(() => [\n 'v-wysiwyg-editor',\n control.classes.value,\n `v-wysiwyg-editor--${control.size.value}`,\n {\n 'v-wysiwyg-editor--disabled-min-height': props.disabledMinHeight,\n 'v-wysiwyg-editor--disabled-max-height': props.disabledMaxHeight,\n },\n ]);\n\n const inputControl = new TextableControl(props, ctx as any, {\n nodeType: VUI_WYSIWYG_EDITOR_SYMBOL,\n validationValue: () => textRef.value,\n });\n\n const getOutput = (\n editor: Pick<Editor, 'isEmpty' | 'getHTML' | 'getText'>,\n type: 'text' | 'html',\n ) => {\n if (props.removeDefaultWrapper && editor.isEmpty) return '';\n if (type === 'html') return editor.getHTML();\n if (type === 'text') return editor.getText();\n return '';\n };\n\n const initializeCtx = new WysiwygEditorInitializeContext(() => vui, {\n onCreate: ({ editor }) => {\n textRef.value = getOutput(editor, 'text');\n updateEditable();\n },\n onFocus: ({ event }) => {\n inputControl.focusHandler(event);\n },\n onBlur: ({ event }) => {\n inputControl.blurHandler(event);\n },\n onUpdate: ({ editor }) => {\n inputControl.value = getOutput(editor, 'html');\n textRef.value = getOutput(editor, 'text');\n },\n });\n\n const extensions = [\n StarterKit.configure({\n bold: false,\n bulletList: false,\n orderedList: false,\n undoRedo: false,\n italic: false,\n }),\n ...resolveRawWysiwygExtensions(props.extensions, initializeCtx),\n ...wysiwygSettings.value.extensions,\n ];\n\n const updateEditable = () => {\n if (!editor.value) return;\n editor.value.setEditable(inputControl.canOperation);\n };\n\n watch(() => inputControl.canOperation, updateEditable);\n\n watch(\n () => props.modelValue,\n (modelValue) => {\n const $editor = editor.value;\n if (!$editor || getOutput($editor, 'html') === modelValue) return;\n\n $editor.commands.setContent(modelValue == null ? '' : modelValue, {\n emitUpdate: false,\n });\n textRef.value = getOutput($editor, 'text');\n },\n );\n\n initializeCtx.on('create', ({ editor }) => {\n textRef.value = getOutput(editor, 'text');\n updateEditable();\n });\n\n const editor = useEditor({\n ...initializeCtx.editorOptions(),\n autofocus: props.autofocus,\n content: props.modelValue,\n extensions,\n editorProps: {\n attributes: {\n class: 'v-wysiwyg-editor__input__prose',\n },\n },\n });\n\n const focus = (\n position?: FocusPosition,\n options?: {\n scrollIntoView?: boolean | undefined;\n },\n ) => editor.value?.chain().focus(position, options);\n\n const wysiwygContext = computed<WysiwygEditorContext>(() => ({\n vui,\n editor: editor.value!,\n }));\n\n const createTools = (bubbleMenu = false) => {\n const { value: settings } = wysiwygSettings;\n const { value: context } = wysiwygContext;\n const tools = bubbleMenu\n ? settings.tools.filter((t) => !!t.floating)\n : settings.tools;\n const _editor = editor.value;\n const variant = vui.setting(\n bubbleMenu ? 'containedVariant' : 'plainVariant',\n );\n\n return (\n <VButtonGroup\n class={[\n 'v-wysiwyg-editor__toolbar',\n {\n 'v-wysiwyg-editor__floating-toolbar': props.floatingToolbar,\n },\n ]}\n variant={variant}>\n {tools.map(({ key, icon, onClick, disabled, active }) => {\n const isActive =\n !!_editor && resolveContextualValue(context, active);\n const isDisabled =\n !inputControl.canOperation ||\n (!!_editor && resolveContextualValue(context, disabled));\n let iconName: IconName | undefined;\n let child: VNodeChild;\n\n if (typeof icon === 'function') {\n if (_editor) {\n const _child = icon(context);\n if (typeof _child === 'function') {\n child = _child();\n } else {\n iconName = _child as any;\n }\n }\n } else {\n iconName = icon;\n }\n\n if (!iconName && child == null) return;\n\n return (\n <VButton\n tabindex={-1}\n key={key}\n icon={iconName}\n onClick={(ev) => onClick(context, ev)}\n color={isActive ? toolButtonActiveColor : undefined}\n disabled={isDisabled}>\n {child}\n </VButton>\n );\n })}\n </VButtonGroup>\n );\n };\n\n onBeforeUnmount(() => {\n editor.value?.destroy();\n });\n\n const api: VWysiwygEditorAPI = {\n get editor() {\n return editor.value;\n },\n control: inputControl,\n };\n\n ctx.expose(api);\n\n const handleClickLabel = (ev: PointerEvent) => {\n focus('start', { scrollIntoView: true });\n };\n\n const defaultSlot = () => (\n <div class=\"v-wysiwyg-editor__body\">\n <EditorContent\n class=\"v-wysiwyg-editor__input__element wysiwyg\"\n editor={editor.value}\n />\n {!props.floatingToolbar &&\n !!editor.value &&\n !inputControl.isReadonly && (\n <BubbleMenu editor={editor.value}>\n <div class=\"v-wysiwyg-editor__bubble-menu\">\n {createTools(true)}\n </div>\n </BubbleMenu>\n )}\n </div>\n );\n\n const formControlDefaultSlot = () => (\n <div class=\"v-wysiwyg-editor__wrapper\">\n {!inputControl.isReadonly && createTools()}\n <VControlField\n class=\"v-wysiwyg-editor__input\"\n autoHeight\n startAdornment={props.startAdornment}\n endAdornment={props.endAdornment}\n size={control.size.value}\n v-slots={{\n ...ctx.slots,\n default: withCtx(defaultSlot),\n }}\n />\n </div>\n );\n\n const infoAppendsSlot = () => {\n const { counterResult } = inputControl;\n if (!counterResult) return;\n return <VTextCounter {...counterResult} />;\n };\n\n return () => (\n <VFormControl\n nodeControl={inputControl}\n class={classes.value}\n label={props.label}\n hint={props.hint}\n hinttip={props.hinttip}\n hiddenInfo={props.hiddenInfo}\n requiredChip={props.requiredChip}\n onClickLabel={handleClickLabel}\n v-slots={{\n ...ctx.slots,\n default: withCtx(formControlDefaultSlot),\n infoAppends: withCtx(infoAppendsSlot),\n }}\n />\n );\n },\n});\n\nfunction resolveContextualValue(\n ctx: WysiwygEditorContext,\n source?: boolean | ((ctx: WysiwygEditorContext) => boolean),\n) {\n return typeof source === 'function' ? source(ctx) : source;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAM,qBAAuC,WAC3C,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,OAAO,MAAM,CAAC;AAgBtD,IAAa,iCAAb,MAA4C;CAC1C,YAAgD,CAAC;CAEjD;CAEA,IAAI,MAAM;EACR,OAAO,KAAK,KAAK;CACnB;CAEA,YACE,WACA,OAAmC,CAAC,GACpC;EACA,KAAK,OAAO;EAEZ,cAAc,SAAS,UAAU;GAC/B,KAAK,UAAU,SAAS,CAAC;GAEzB,MAAM,KAAK,KADM,kBAAkB,KACZ;GACvB,MAAM,KAAK,UAAU,MAAM,CAAC,KAAK,EAAS;EAC5C,CAAC;CACH;CAEA,GACE,IACA,SACA;EACA,KAAK,UAAU,GAAG,CAAC,KAAK,OAAO;EAC/B,aAAa,KAAK,IAAI,IAAI,OAAO;CACnC;CAEA,IACE,IACA,SACA;EACA,KAAK,UAAU,MAAM,KAAK,UAAU,GAAG,CAAC,QACrC,aAAa,aAAa,OAC7B;CACF;CAEA,gBAAgB;EACd,MAAM,OAAmC,CAAC;EAE1C,cAAc,SAAS,UAAU;GAC/B,MAAM,WAAW,kBAAkB,KAAK;GACxC,KAAK,aAAa,UAAU;IAE1B,KADsB,UAAU,MACxB,CAAC,SAAS,YAAY;KAC5B,QAAQ,KAAY;IACtB,CAAC;GACH;EACF,CAAC;EAED,OAAO;CACT;AACF;AA4CA,SAAS,0BACP,QAC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SAAS,uBACP,KACA,QACA;CACA,OAAO,OAAO,WAAW,aAAa,OAAO,GAAG,IAAI;AACtD"}
|
|
1
|
+
{"version":3,"file":"vui-wysiwyg.mjs","names":[],"sources":["../src/schema.ts","../src/injections.ts","../src/extensions/linter/Linter.tsx","../src/extensions/linter/utils.ts","../src/extensions/linter/LinterPlugin.ts","../src/extensions/linter/plugins/BadWords.tsx","../src/extensions/linter/plugins/HeadingLevel.ts","../src/extensions/linter/plugins/Punctuation.ts","../src/extensions/color.ts","../src/extensions/custom-tag.ts","../src/tools/bullet-list.ts","../src/tools/format-bold.ts","../src/tools/format-italic.ts","../src/tools/format-underline.ts","../src/tools/history.ts","../src/tools/link.ts","../src/tools/ordered-list.ts","../src/tools/color.tsx","../src/tools/text-align.tsx","../src/tools/custom-tag.ts","../src/components/VWysiwygEditor/VWysiwygEditor.tsx"],"sourcesContent":["import { type VuiService, type IconName } from '@fastkit/vui';\nimport {\n type Editor,\n type Extensions,\n type Node,\n type Extension,\n type Mark,\n type AnyExtension,\n type EditorOptions,\n} from '@tiptap/vue-3';\nimport { VNodeChild } from 'vue';\n\nconst EDITOR_EVENTS = [\n 'beforeCreate',\n 'create',\n 'update',\n 'selectionUpdate',\n 'transaction',\n 'focus',\n 'blur',\n 'destroy',\n] as const;\n\ntype PrefixedEventName<S extends string> = `on${Capitalize<S>}`;\n\nconst prefixedEventName = <S extends string>(source: S): PrefixedEventName<S> =>\n `on${source.charAt(0).toUpperCase()}${source.slice(1)}` as any;\n\nexport type WysiwygEditorEvent = (typeof EDITOR_EVENTS)[number];\n\nexport type WysiwygEditorPrefixedEvent = PrefixedEventName<WysiwygEditorEvent>;\n\nexport interface WysiwygEditorEventsOptions extends Partial<\n Pick<EditorOptions, WysiwygEditorPrefixedEvent>\n> {}\n\nexport type WysiwygEditorEventsBucket = {\n [EV in WysiwygEditorEvent]: NonNullable<\n WysiwygEditorEventsOptions[PrefixedEventName<EV>]\n >[];\n};\n\nexport class WysiwygEditorInitializeContext {\n readonly listeners: WysiwygEditorEventsBucket = {} as any;\n\n private readonly _vui: () => VuiService;\n\n get vui() {\n return this._vui();\n }\n\n constructor(\n vuiGetter: () => VuiService,\n opts: WysiwygEditorEventsOptions = {},\n ) {\n this._vui = vuiGetter;\n\n EDITOR_EVENTS.forEach((event) => {\n this.listeners[event] = [];\n const prefixed = prefixedEventName(event);\n const fn = opts[prefixed];\n fn && this.listeners[event].push(fn as any);\n });\n }\n\n on<EV extends WysiwygEditorEvent>(\n ev: EV,\n handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>,\n ) {\n this.listeners[ev].push(handler);\n return () => this.off(ev, handler);\n }\n\n off<EV extends WysiwygEditorEvent>(\n ev: EV,\n handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>,\n ) {\n this.listeners[ev] = this.listeners[ev].filter(\n (_handler) => _handler !== handler,\n ) as any;\n }\n\n editorOptions() {\n const opts: WysiwygEditorEventsOptions = {};\n\n EDITOR_EVENTS.forEach((event) => {\n const prefixed = prefixedEventName(event);\n opts[prefixed] = (props) => {\n const handlers = this.listeners[event];\n handlers.forEach((handler) => {\n handler(props as any);\n });\n };\n });\n\n return opts;\n }\n}\n\nexport interface WysiwygEditorContext {\n editor: Editor;\n vui: VuiService;\n}\n\nexport type WysiwygExtensionFactory<Options = any, Storage = any> = (\n ctx: WysiwygEditorInitializeContext,\n) =>\n Extension<Options, Storage> | Node<Options, Storage> | Mark<Options, Storage>;\n\nexport interface CreatedWysiwygExtension<Options = any, Storage = any> {\n __isCreatedWysiwygExtension: true;\n _configs: Partial<Options>[];\n configure(\n options?: Partial<Options>,\n ): CreatedWysiwygExtension<Options, Storage>;\n raw: WysiwygExtensionSource<Options, Storage>;\n}\n\nexport type WysiwygExtensionSource<Options = any, Storage = any> =\n | Extension<Options, Storage>\n | Node<Options, Storage>\n | Mark<Options, Storage>\n | WysiwygExtensionFactory<Options, Storage>;\n\nexport type RawWysiwygExtension<Options = any, Storage = any> =\n | WysiwygExtensionSource<Options, Storage>\n | CreatedWysiwygExtension<Options, Storage>;\n\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// extension: Extension<Options, Storage>,\n// ): Extension<Options, Storage>;\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// node: Node<Options, Storage>,\n// ): Node<Options, Storage>;\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// mark: Mark<Options, Storage>,\n// ): Mark<Options, Storage>;\n// export function createWysiwygExtension<Options = any, Storage = any>(\n// factory: WysiwygExtensionFactory<Options, Storage>,\n// ): WysiwygExtensionFactory<Options, Storage>;\n\nfunction isCreatedWysiwygExtension<Options = any, Storage = any>(\n source: unknown,\n): source is CreatedWysiwygExtension<Options, Storage> {\n return (\n !!source &&\n typeof source === 'object' &&\n (source as CreatedWysiwygExtension).__isCreatedWysiwygExtension === true\n );\n}\n\nexport function createWysiwygExtension<Options = any, Storage = any>(\n extension: WysiwygExtensionSource<Options, Storage>,\n) {\n const ext: CreatedWysiwygExtension<Options, Storage> = {\n __isCreatedWysiwygExtension: true,\n _configs: [],\n configure: (opts) => {\n opts && ext._configs.push(opts);\n return ext;\n },\n raw: extension,\n };\n return ext;\n}\n\nfunction resolveRawWysiwygExtension(\n raw: RawWysiwygExtension,\n ctx: WysiwygEditorInitializeContext,\n): AnyExtension {\n if (isCreatedWysiwygExtension(raw)) {\n const { raw: _raw, _configs } = raw;\n let ext = typeof _raw === 'function' ? _raw(ctx) : _raw;\n _configs.forEach((config) => {\n ext = ext.configure(config);\n });\n return ext;\n }\n return typeof raw === 'function' ? raw(ctx) : raw;\n}\n\nexport function resolveRawWysiwygExtensions(\n raws: RawWysiwygExtension[],\n ctx: WysiwygEditorInitializeContext,\n) {\n return raws.map((raw) => resolveRawWysiwygExtension(raw, ctx));\n}\n\nexport type WysiwygEditorToolIcon =\n | IconName\n | ((ctx: WysiwygEditorContext) => IconName | (() => VNodeChild) | undefined);\n\n/**\n * Tool Configuration\n */\nexport interface WysiwygEditorTool {\n /**\n * Tool Key\n *\n * Must be unique to identify the tool\n */\n key: string;\n /** Icons to be displayed on the toolbar */\n icon: WysiwygEditorToolIcon;\n /** Conditions for displaying the icon as active */\n active?: boolean | ((ctx: WysiwygEditorContext) => boolean);\n /** Conditions for deactivating the icon */\n disabled?: boolean | ((ctx: WysiwygEditorContext) => boolean);\n /** Handler when mark text is clicked */\n onClick: (ctx: WysiwygEditorContext, ev: PointerEvent) => any;\n /** Whether to display tools in floating menu or not */\n floating?: boolean;\n /** Extensions that the tool depends on */\n extensions?: Extensions;\n}\n\nexport type WysiwygEditorToolFactory<Options = void> = (\n vui: VuiService,\n options?: Options,\n) => WysiwygEditorTool | WysiwygEditorTool[];\n\nexport type RawWysiwygEditorTool =\n WysiwygEditorTool | WysiwygEditorToolFactory<any>;\n\nfunction resolveRawWysiwygEditorTool(\n raw: RawWysiwygEditorTool,\n vui: VuiService,\n) {\n return typeof raw === 'function' ? raw(vui) : raw;\n}\n\nexport interface ResolvedWysiwygEditorSettings {\n tools: WysiwygEditorTool[];\n extensions: Extensions;\n}\n\nexport function resolveRawWysiwygEditorTools(\n rawTools: RawWysiwygEditorTool[],\n vui: VuiService,\n): ResolvedWysiwygEditorSettings {\n const tools: WysiwygEditorTool[] = [];\n const extensions: Extensions = [];\n\n rawTools.forEach((raw) => {\n let resolved = resolveRawWysiwygEditorTool(raw, vui);\n if (!Array.isArray(resolved)) {\n resolved = [resolved];\n }\n resolved.forEach((tool) => {\n tools.push(tool);\n if (tool.extensions) {\n extensions.push(...tool.extensions);\n }\n });\n });\n\n return {\n tools,\n extensions,\n };\n}\n","export const VUI_WYSIWYG_EDITOR_SYMBOL = 'vui-wysiwyg-editor';\n","import './Linter.scss';\n\nimport { Extension } from '@tiptap/vue-3';\nimport { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view';\nimport { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state';\nimport { Node as ProsemirrorNode } from '@tiptap/pm/model';\nimport {\n WysiwygLinterPlugin,\n WysiwygLinterResult as Issue,\n WysiwygLinterFixMessage,\n} from './LinterPlugin';\nimport { createWysiwygExtension } from '../../schema';\n\nconst PROBLEM_CLASS_NAME = 'v-linter__problem';\nconst ISSUE_ICON_CLASS_NAME = 'v-linter__issue-icon';\nconst ISSUE_DATASET_NAME = 'data-issue-id';\n\nfunction resolveWysiwygLinterFixMessage(message: WysiwygLinterFixMessage) {\n return typeof message === 'function' ? message() : message;\n}\n\nfunction renderIcon(view: EditorView, issue: Issue) {\n const { level = 'warning' } = issue;\n const icon = document.createElement('div');\n const message = resolveWysiwygLinterFixMessage(issue.message);\n\n icon.className = `${ISSUE_ICON_CLASS_NAME} ${level}-scope`;\n icon.setAttribute(ISSUE_DATASET_NAME, issue.id);\n\n if (typeof message === 'string') {\n icon.title = message;\n }\n\n return icon;\n}\n\nfunction runAllLinterPlugins(\n doc: ProsemirrorNode,\n plugins: Array<typeof WysiwygLinterPlugin>,\n) {\n const decorations: [any?] = [];\n\n const issues = plugins\n .map((RegisteredLinterPlugin) =>\n new RegisteredLinterPlugin(doc).scan().getResults(),\n )\n .flat();\n\n issues.forEach((issue) => {\n const { level = 'warning', icon } = issue;\n const message = resolveWysiwygLinterFixMessage(issue.message);\n decorations.push(\n Decoration.inline(issue.from, issue.to, {\n class: `${PROBLEM_CLASS_NAME} ${level}-scope`,\n 'data-issue-id': issue.id,\n title: typeof message === 'string' ? message : undefined,\n }),\n );\n if (icon) {\n decorations.push(\n Decoration.widget(issue.from, (view) => renderIcon(view, issue)),\n );\n }\n });\n\n const decorationSet = DecorationSet.create(doc, decorations);\n\n return {\n issues,\n decorationSet,\n };\n}\n\nexport interface WysiwygLinterOptions {\n plugins: Array<typeof WysiwygLinterPlugin>;\n}\n\nexport interface WysiwygLinterStorage {\n issues: Issue[];\n}\n\nexport const WysiwygLinter = createWysiwygExtension((ctx) => {\n function showMenu(view: EditorView, issue: Issue, event: Event) {\n const message = resolveWysiwygLinterFixMessage(issue.message);\n const variant = ctx.vui.setting('containedVariant');\n const scope = ctx.vui.setting(`${issue.level}Scope`);\n\n return ctx.vui.menu({\n activator: event,\n content: (stack) => (\n <div class=\"v-linter__issue-menu__body\">\n <div\n class={[\n 'v-linter__issue-menu__message',\n `${scope}-scope ${variant}`,\n ]}>\n {message}\n </div>\n {issue.fix.length && (\n <div class=\"v-linter__issue-menu__fixers\">\n {issue.fix.map((fixer, index) => (\n <div key={index} class=\"v-linter__issue-menu__fixer\">\n <button\n type=\"button\"\n class=\"v-linter__issue-menu__fixer__button\"\n onClick={() => {\n stack.close();\n fixer.handler(view, issue);\n }}>\n <span class=\"v-linter__issue-menu__fixer__button__message\">\n {resolveWysiwygLinterFixMessage(fixer.message)}\n </span>\n </button>\n </div>\n ))}\n </div>\n )}\n </div>\n ),\n });\n }\n\n return Extension.create<WysiwygLinterOptions, WysiwygLinterStorage>({\n name: 'linter',\n\n addOptions() {\n return {\n plugins: [],\n };\n },\n addStorage() {\n return {\n issues: [],\n };\n },\n addProseMirrorPlugins() {\n const { plugins } = this.options;\n const { storage } = this;\n\n const runAll = (doc: ProsemirrorNode) => {\n const { issues, decorationSet } = runAllLinterPlugins(doc, plugins);\n storage.issues = issues;\n return decorationSet;\n };\n\n const getIssue = (id: string) =>\n storage.issues.find((issue) => issue.id === id);\n\n const getIssueElementByEvent = (\n source: EventTarget | null,\n ):\n | {\n issue: Issue;\n }\n | undefined => {\n if (!source || !(source instanceof HTMLElement)) {\n return;\n }\n const issueId = source.getAttribute(ISSUE_DATASET_NAME);\n const issue = issueId && getIssue(issueId);\n if (!issue) return;\n\n return {\n issue,\n };\n };\n\n const linterPlugin: Plugin<any> = new Plugin({\n key: new PluginKey('linter'),\n state: {\n init(_, { doc }) {\n return runAll(doc);\n },\n apply(transaction, oldState) {\n return transaction.docChanged ? runAll(transaction.doc) : oldState;\n },\n },\n props: {\n decorations(state) {\n return linterPlugin.getState(state);\n },\n handleClick(view, _, event) {\n const info = getIssueElementByEvent(event.target);\n if (!info) {\n return false;\n }\n\n const { issue } = info;\n const { from, to } = issue;\n\n const focus = () =>\n view.dispatch(\n view.state.tr\n .setSelection(TextSelection.create(view.state.doc, from, to))\n .scrollIntoView(),\n );\n\n focus();\n\n showMenu(view, issue, event);\n return true;\n },\n },\n });\n\n return [linterPlugin];\n },\n });\n});\n","let IDX = 256;\nlet BUFFER: any;\nconst HEX: any = [];\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nexport function cheepUUID() {\n let i = 0;\n let num;\n let out = '';\n\n if (!BUFFER || IDX + 16 > 256) {\n BUFFER = Array((i = 256));\n while (i--) BUFFER[i] = (256 * Math.random()) | 0;\n\n i = IDX = 0;\n }\n\n for (; i < 16; i++) {\n num = BUFFER[IDX + i];\n if (i == 6) out += HEX[(num & 15) | 64];\n else if (i == 8) out += HEX[(num & 63) | 128];\n else out += HEX[num];\n\n if (i & 1 && i > 1 && i < 11) out += '-';\n }\n\n IDX++;\n return out;\n}\n","import { VNodeChild } from 'vue';\nimport { Node as ProsemirrorNode } from '@tiptap/pm/model';\nimport { EditorView } from '@tiptap/pm/view';\nimport { cheepUUID } from './utils';\n\nexport type WysiwygLinterFixFn = (\n view: EditorView,\n issue: WysiwygLinterResult,\n) => any;\n\nexport type WysiwygLinterFixMessage = string | (() => VNodeChild);\n\nexport interface WysiwygLinterFixer {\n message: WysiwygLinterFixMessage;\n handler: WysiwygLinterFixFn;\n}\n\nexport type WysiwygLinterResultLevel = 'warning' | 'error';\n\n// fixers\nexport interface WysiwygLinterResult {\n id: string;\n icon: boolean;\n level: WysiwygLinterResultLevel;\n message: WysiwygLinterFixMessage;\n from: number;\n to: number;\n fix: WysiwygLinterFixer[];\n}\n\nexport interface RawLinterResult extends Omit<\n WysiwygLinterResult,\n 'level' | 'fix' | 'id' | 'icon'\n> {\n level?: WysiwygLinterResultLevel;\n icon?: boolean;\n fix?: WysiwygLinterFixer | WysiwygLinterFixer[];\n}\n\nexport class WysiwygLinterPlugin {\n protected doc: ProsemirrorNode;\n\n private results: Array<WysiwygLinterResult> = [];\n\n constructor(doc: ProsemirrorNode) {\n this.doc = doc;\n }\n\n record(result: RawLinterResult) {\n const { fix = [], icon = false } = result;\n this.results.push({\n level: 'error',\n id: cheepUUID(),\n ...result,\n fix: Array.isArray(fix) ? fix : [fix],\n icon,\n });\n }\n\n scan() {\n return this;\n }\n\n getResults() {\n return this.results;\n }\n}\n","import { WysiwygLinterPlugin } from '../LinterPlugin';\n\nexport function WysiwygLinterBadWords(\n words: string[],\n): typeof WysiwygLinterPlugin {\n const regex = new RegExp(`\\\\b(${words.join('|')})\\\\b`);\n\n return class WysiwygLinterBadWords extends WysiwygLinterPlugin {\n scan() {\n this.doc.descendants((node: any, position: number) => {\n if (!node.isText) {\n return;\n }\n\n const matches = regex.exec(node.text);\n\n if (matches) {\n const fixValue = `${matches[0]}!!!!!`;\n\n this.record({\n level: 'warning',\n message: `Try not to say '${matches[0]}'`,\n from: position + matches.index,\n to: position + matches.index + matches[0].length,\n fix: [\n {\n message: () => (\n <span>\n <code>{fixValue}</code>に修正する。\n </span>\n ),\n handler: () => {\n // eslint-disable-next-line no-console\n console.log('hoge');\n },\n },\n {\n message: 'どうにかする',\n handler: () => {\n // eslint-disable-next-line no-console\n console.log('hoge');\n },\n },\n ],\n });\n }\n });\n\n return this;\n }\n };\n}\n","import { EditorView } from '@tiptap/pm/view';\nimport {\n WysiwygLinterPlugin,\n WysiwygLinterResult as Issue,\n} from '../LinterPlugin';\n\nexport class WysiwygLinterHeadingLevel extends WysiwygLinterPlugin {\n fixHeader(level: number) {\n return function ({ state, dispatch }: EditorView, issue: Issue) {\n dispatch(state.tr.setNodeMarkup(issue.from - 1, undefined, { level }));\n };\n }\n\n scan() {\n let lastHeadLevel: number | null = null;\n\n this.doc.descendants((node, position) => {\n if (node.type.name === 'heading') {\n // Check whether heading levels fit under the current level\n const { level } = node.attrs;\n\n if (lastHeadLevel != null && level > lastHeadLevel + 1) {\n this.record({\n message: `Heading too small (${level} under ${lastHeadLevel})`,\n from: position + 1,\n to: position + 1 + node.content.size,\n fix: {\n message: '修正する',\n handler: this.fixHeader(lastHeadLevel + 1),\n },\n });\n }\n lastHeadLevel = level;\n }\n });\n\n return this;\n }\n}\n","import { EditorView } from '@tiptap/pm/view';\nimport {\n WysiwygLinterPlugin,\n WysiwygLinterResult as Issue,\n} from '../LinterPlugin';\n\nexport class WysiwygLinterPunctuation extends WysiwygLinterPlugin {\n public regex = / ([,.!?:]) ?/g;\n\n fix(replacement: any) {\n return function ({ state, dispatch }: EditorView, issue: Issue) {\n dispatch(\n state.tr.replaceWith(\n issue.from,\n issue.to,\n state.schema.text(replacement),\n ),\n );\n };\n }\n\n scan() {\n this.doc.descendants((node, position) => {\n if (!node.isText) {\n return;\n }\n\n if (!node.text) {\n return;\n }\n\n const matches = this.regex.exec(node.text);\n\n if (matches) {\n this.record({\n message: 'Suspicious spacing around punctuation',\n from: position + matches.index,\n to: position + matches.index + matches[0].length,\n fix: {\n message: 'Fix it!!!',\n handler: this.fix(`${matches[1]} `),\n },\n });\n }\n });\n\n return this;\n }\n}\n","import { Extension } from '@tiptap/vue-3';\nimport '@tiptap/extension-text-style';\n\nexport type WysiwygColorOptions = {\n types: string[];\n};\n\ndeclare module '@tiptap/vue-3' {\n interface Commands<ReturnType> {\n color: {\n /**\n * Set the text color\n */\n setColor: (color: string) => ReturnType;\n /**\n * Unset the text color\n */\n unsetColor: () => ReturnType;\n };\n }\n}\n\nexport const WysiwygColorExtension = Extension.create<WysiwygColorOptions>({\n name: 'color',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n color: {\n default: null,\n parseHTML: (element) => element.style.color.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.color) {\n return {};\n }\n\n return {\n style: `color: ${attributes.color}`,\n };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setColor:\n (color) =>\n ({ chain }) =>\n chain().setMark('textStyle', { color }).run(),\n unsetColor:\n () =>\n ({ chain }) =>\n chain()\n .setMark('textStyle', { color: null })\n .removeEmptyTextStyle()\n .run(),\n };\n },\n});\n","import { Extension, mergeAttributes, Mark } from '@tiptap/vue-3';\nimport '@tiptap/extension-text-style';\n// import '@tiptap/vue-3';\n\nexport type WysiwygCustomTagSettings = {\n /**\n * tag name\n *\n * Either the html default tag name or a custom tag name is acceptable\n *\n * @default \"span\"\n */\n tag: string;\n\n /**\n * HTML Attributes\n *\n * Attributes to be assigned to tags such as `class`, `data-xxx`, etc.\n */\n attrs?: Record<any, string>;\n};\n\ndeclare module '@tiptap/vue-3' {\n interface Commands<ReturnType> {\n customTag: {\n /**\n * Set the custom tag\n */\n setCustomTag: (markName: string) => ReturnType;\n /**\n * Toggle the custom tag\n */\n toggleCustomTag: (markName: string) => ReturnType;\n /**\n * Unset the custom tag\n */\n unsetCustomTag: (markName: string) => ReturnType;\n };\n }\n}\n\n// export type WysiwygCustomTagSettings = WysiwygCustomTagOptions & {\n// /**\n// * extension name\n// */\n// name: string;\n// };\n\nexport function createWysiwygCustomTagMark(\n name: string,\n settings: Partial<WysiwygCustomTagSettings>,\n) {\n const { tag = 'span', attrs } = settings;\n const attrEntries = attrs && Object.entries(attrs);\n const attrNames = attrEntries && attrEntries.map(([name]) => name);\n\n const getElementAttrs = (\n el: HTMLElement,\n ): Record<any, string> | undefined => {\n if (!attrNames) return;\n\n return el\n .getAttributeNames()\n\n .reduce((acc, name) => ({ ...acc, [name]: el.getAttribute(name) }), {});\n };\n\n const isMatchedElementAttrs = (elAttrs: Record<any, string>): boolean => {\n if (!attrEntries) return true;\n\n return attrEntries.every(([name, value]) => elAttrs[name] === value);\n };\n\n return Mark.create<WysiwygCustomTagSettings>({\n name,\n\n addOptions() {\n return {\n tag,\n attrs: attrs && { ...attrs },\n };\n },\n parseHTML() {\n return [\n {\n tag,\n getAttrs: (el: any) => {\n if (!attrs) return null;\n const elAttrs = getElementAttrs(el);\n if (!elAttrs) return false;\n return isMatchedElementAttrs(el) && null;\n },\n },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\n tag,\n attrs ? mergeAttributes(attrs, HTMLAttributes) : HTMLAttributes,\n 0,\n ];\n },\n });\n}\n\nexport const WysiwygCustomTagExtension =\n Extension.create<WysiwygCustomTagSettings>({\n name: 'custom-tag',\n addCommands() {\n return {\n setCustomTag:\n (markName) =>\n ({ chain }) =>\n chain().setMark(markName).run(),\n unsetCustomTag:\n (markName) =>\n ({ chain }) =>\n chain().unsetMark(markName).run(),\n toggleCustomTag:\n (markName) =>\n ({ chain }) =>\n chain().toggleMark(markName).run(),\n };\n },\n });\n","import { BulletList, BulletListOptions } from '@tiptap/extension-bullet-list';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygBulletListTool: WysiwygEditorToolFactory<\n BulletListOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'bulletList',\n icon: vui.icon('editorformatListBulleted'),\n active: ({ editor }) => editor.isActive('bulletList'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleBulletList().run();\n },\n floating: true,\n extensions: [BulletList.configure(options)],\n };\n return tool;\n};\n","import { Bold, BoldOptions } from '@tiptap/extension-bold';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygFormatBoldTool: WysiwygEditorToolFactory<BoldOptions> = (\n vui,\n options,\n) => {\n const tool: WysiwygEditorTool = {\n key: 'formatBold',\n icon: vui.icon('editorformatBold'),\n active: ({ editor }) => editor.isActive('bold'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleBold().run();\n },\n floating: true,\n extensions: [Bold.configure(options)],\n };\n return tool;\n};\n","import { Italic, ItalicOptions } from '@tiptap/extension-italic';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygFormatItalicTool: WysiwygEditorToolFactory<\n ItalicOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'formatItalic',\n icon: vui.icon('editorformatItalic'),\n active: ({ editor }) => editor.isActive('italic'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleItalic().run();\n },\n floating: true,\n extensions: [Italic.configure(options)],\n };\n return tool;\n};\n","import { Underline, UnderlineOptions } from '@tiptap/extension-underline';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygFormatUnderlineTool: WysiwygEditorToolFactory<\n UnderlineOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'formatUnderline',\n icon: vui.icon('editorformatUnderline'),\n active: ({ editor }) => editor.isActive('underline'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleUnderline().run();\n },\n floating: true,\n extensions: [Underline.configure(options)],\n };\n return tool;\n};\n","import { History, HistoryOptions } from '@tiptap/extension-history';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygHistoryTool: WysiwygEditorToolFactory<HistoryOptions> = (\n vui,\n options,\n) => {\n const undo: WysiwygEditorTool = {\n key: 'history-undo',\n icon: vui.icon('editorUndo'),\n disabled: ({ editor }) => !editor.can().undo(),\n onClick: ({ editor }) => {\n editor.chain().focus().undo().run();\n },\n extensions: [History.configure(options)],\n };\n const redo: WysiwygEditorTool = {\n key: 'history-redo',\n icon: vui.icon('editorRedo'),\n disabled: ({ editor }) => !editor.can().redo(),\n onClick: ({ editor }) => {\n editor.chain().focus().redo().run();\n },\n };\n return [undo, redo];\n};\n","import { Link, LinkOptions } from '@tiptap/extension-link';\nimport { validateIf, url } from '@fastkit/vui';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygLinkTool: WysiwygEditorToolFactory<LinkOptions> = (\n vui,\n options,\n) => {\n const tool: WysiwygEditorTool = {\n key: 'link',\n icon: vui.icon('editorLink'),\n active: ({ editor }) => editor.isActive('link'),\n onClick: async ({ vui, editor }) => {\n const { href = '' } = editor.getAttributes('link');\n const result = await vui.prompt({\n input: {\n label: 'Link URL',\n rules: [validateIf, url],\n initialValue: href,\n size: 'sm',\n autofocus: true,\n },\n });\n\n if (result === undefined || result === false) {\n return;\n }\n\n const range = editor.chain().focus().extendMarkRange('link');\n\n if (!result) {\n range.unsetLink().run();\n } else {\n range\n .setLink({\n href: result,\n })\n .run();\n }\n },\n floating: true,\n extensions: [\n Link.configure({\n openOnClick: false,\n ...options,\n }),\n ],\n };\n return tool;\n};\n","import {\n OrderedList,\n OrderedListOptions,\n} from '@tiptap/extension-ordered-list';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport const WysiwygOrderedListTool: WysiwygEditorToolFactory<\n OrderedListOptions\n> = (vui, options) => {\n const tool: WysiwygEditorTool = {\n key: 'orderedList',\n icon: vui.icon('editorformatListNumbered'),\n active: ({ editor }) => editor.isActive('orderedList'),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleOrderedList().run();\n },\n floating: true,\n extensions: [OrderedList.configure(options)],\n };\n return tool;\n};\n","import './color.scss';\n\nimport { VNodeChild } from 'vue';\nimport { type VuiService, VIcon } from '@fastkit/vui';\nimport { TextStyle } from '@tiptap/extension-text-style';\nimport { WysiwygColorExtension } from '../extensions';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\nexport interface WysiwygColorItem {\n key?: string | number;\n name?: VNodeChild | ((vui: VuiService) => VNodeChild);\n color: string | null;\n}\n\nexport interface CreateWysiwygColorToolOptions {\n items: WysiwygColorItem[];\n withLabel?: boolean;\n}\n\nexport function createWysiwygColorTool(opts: CreateWysiwygColorToolOptions) {\n const WysiwygColorTool: WysiwygEditorToolFactory = (vui) => {\n const tool: WysiwygEditorTool = {\n key: 'textColor',\n // active: ({ editor }) => editor.isActive('textStyle'),\n icon:\n ({ editor }) =>\n () => {\n const { color } = editor.getAttributes('textStyle');\n const style = { color };\n return (\n <span class=\"v-wysiwyg-color-tool__button\">\n <VIcon\n class=\"v-wysiwyg-color-tool__button__icon\"\n name={vui.icon('editorTextColor')}\n />\n <span class=\"v-wysiwyg-color-tool__button__bar\" style={style} />\n </span>\n );\n },\n onClick: (ctx, ev) => {\n ctx.vui.menu({\n class: 'v-wysiwyg-color-tool__menu',\n activator: ev,\n content: (stack) => (\n <div\n class={[\n 'v-wysiwyg-color-tool__items',\n { 'v-wysiwyg-color-tool__items--with-label': opts.withLabel },\n ]}>\n {opts.items.map((item, index) => (\n <button\n key={item.key == null ? index : item.key}\n class=\"v-wysiwyg-color-tool__item\"\n type=\"button\"\n onClick={() => {\n const { color } = item;\n let command = ctx.editor.chain().focus();\n if (color) {\n command = command.setColor(color);\n } else {\n command = command.unsetColor();\n }\n command.run();\n stack.close();\n }}>\n <span\n class=\"v-wysiwyg-color-tool__item__color\"\n style={item.color ? { color: item.color } : {}}\n />\n {opts.withLabel && (\n <span class=\"v-wysiwyg-color-tool__item__name\">\n {item.name}\n </span>\n )}\n </button>\n ))}\n </div>\n ),\n });\n },\n floating: true,\n extensions: [TextStyle, WysiwygColorExtension],\n };\n return tool;\n };\n\n return WysiwygColorTool;\n}\n","import { TextAlign, TextAlignOptions } from '@tiptap/extension-text-align';\nimport { type Editor } from '@tiptap/vue-3';\nimport { VuiServiceIconSettings, VButtonGroup, VButton } from '@fastkit/vui';\nimport { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\n\n/**\n * A list of available options for the text align attribute.\n * @remarks\n * `\"justify\"` has not yet been adopted because of ambiguity in browser support.\n */\nexport const WYSIWYG_TEXT_ALIGN_VALUES = [\n 'left',\n 'center',\n 'right',\n // 'justify',\n] as const;\n\n/** Text align value */\nexport type WysiwygTextAlignValue = (typeof WYSIWYG_TEXT_ALIGN_VALUES)[number];\n\n/**\n * A list of nodes where the text align attribute should be applied to.\n */\nconst DEFAULT_TYPES = ['heading', 'paragraph'] as const;\n\nexport interface WysiwygTextAlignOptions {\n /**\n * A list of nodes where the text align attribute should be applied to. Usually something like `['heading', 'paragraph']`\n * @default DEFAULT_TYPES\n * @see {@link DEFAULT_TYPES}\n */\n types?: TextAlignOptions['types'];\n /**\n * A list of available options for the text align attribute.\n * @default WYSIWYG_TEXT_ALIGN_VALUES\n * @see {@link WYSIWYG_TEXT_ALIGN_VALUES}\n */\n alignments?: WysiwygTextAlignValue[];\n /**\n * The default text align.\n * @default left\n */\n defaultAlignment: WysiwygTextAlignValue;\n}\n\nconst conditions = WYSIWYG_TEXT_ALIGN_VALUES.map<\n [WysiwygTextAlignValue, { textAlign: WysiwygTextAlignValue }]\n>((value) => [value, { textAlign: value }]);\n\nconst ICON_AT: Record<WysiwygTextAlignValue, keyof VuiServiceIconSettings> = {\n left: 'editorAlignLeft',\n center: 'editorAlignCenter',\n right: 'editorAlignRight',\n};\n\nfunction resolveOptions(\n rawOptions: Partial<WysiwygTextAlignOptions> | undefined,\n): Required<WysiwygTextAlignOptions> {\n const types = rawOptions?.types || DEFAULT_TYPES.slice();\n const alignments =\n rawOptions?.alignments || WYSIWYG_TEXT_ALIGN_VALUES.slice();\n const defaultAlignment = rawOptions?.defaultAlignment || 'left';\n\n return {\n types,\n alignments,\n defaultAlignment,\n };\n}\nfunction getCurrentAlign(\n editor: Editor,\n options: WysiwygTextAlignOptions,\n): WysiwygTextAlignValue {\n for (const [align, condition] of conditions) {\n if (editor.isActive(condition)) return align;\n }\n return options.defaultAlignment;\n}\n\nexport const WysiwygTextAlignTool: WysiwygEditorToolFactory<\n WysiwygTextAlignOptions\n> = (vui, options) => {\n const resolvedOptions = resolveOptions(options);\n const { alignments } = resolvedOptions;\n\n const getIcon = (value: WysiwygTextAlignValue) => {\n const iconKey = ICON_AT[value];\n const icon = vui.icon(iconKey);\n if (icon === '$empty' || typeof icon === 'function') return;\n return icon;\n };\n\n const variant = vui.setting('plainVariant');\n const toolButtonActiveColor = vui.setting('primaryScope');\n\n const tool: WysiwygEditorTool = {\n key: 'textAlign',\n icon: ({ editor }) => getIcon(getCurrentAlign(editor, resolvedOptions)),\n onClick: async ({ vui, editor }, ev) => {\n vui.menu({\n distance: 0,\n activator: ev,\n content: (menu) => (\n <VButtonGroup variant={variant}>\n {alignments.map((value) => {\n const isActive = editor.isActive({ textAlign: value });\n return (\n <VButton\n tabindex={-1}\n color={isActive ? toolButtonActiveColor : undefined}\n key={value}\n icon={getIcon(value)}\n onClick={() => {\n editor.chain().focus().setTextAlign(value).run();\n }}\n />\n );\n })}\n </VButtonGroup>\n ),\n });\n },\n floating: true,\n extensions: [TextAlign.configure(resolvedOptions)],\n };\n return tool;\n};\n","import { WysiwygEditorToolFactory, WysiwygEditorTool } from '../schema';\nimport {\n createWysiwygCustomTagMark,\n WysiwygCustomTagSettings,\n WysiwygCustomTagExtension,\n} from '../extensions/custom-tag';\n\nexport interface WysiwygCustomTagToolSettings\n extends\n Pick<WysiwygEditorTool, 'icon' | 'floating'>,\n Partial<WysiwygCustomTagSettings> {}\n\n/**\n * Generate Custom Tag Tool\n *\n * @param markName - Mark name\n * @param settings - Tool Configuration\n * @returns Generated Tool\n */\nexport function createWysiwygCustomTagTool(\n markName: string,\n settings: WysiwygCustomTagToolSettings,\n): WysiwygEditorToolFactory {\n const Mark = createWysiwygCustomTagMark(markName, settings);\n const { icon, floating = true } = settings;\n\n return (vui) => {\n const tool: WysiwygEditorTool = {\n key: `customTag:${markName}`,\n icon,\n floating,\n active: ({ editor }) => editor.isActive(markName),\n onClick: ({ editor }) => {\n editor.chain().focus().toggleCustomTag(markName).run();\n },\n extensions: [WysiwygCustomTagExtension, Mark.configure(settings)],\n };\n return tool;\n };\n}\n","import './VWysiwygEditor.scss';\nimport {\n defineComponent,\n PropType,\n computed,\n ref,\n watch,\n onBeforeUnmount,\n VNodeChild,\n} from 'vue';\nimport {\n createFormNodeWrapperProps,\n FormNodeWrapperSlots,\n VFormControl,\n VControlField,\n createControlFieldProps,\n InputBoxSlots,\n IconName,\n createTextableProps,\n createTextableEmits,\n TextableControl,\n createControlProps,\n useControl,\n createControlFieldProviderProps,\n useControlField,\n VTextCounter,\n defineSlots,\n useVui,\n VButton,\n VButtonGroup,\n withCtx,\n} from '@fastkit/vui';\nimport {\n EditorContent,\n useEditor,\n FocusPosition,\n type Editor,\n} from '@tiptap/vue-3';\nimport { BubbleMenu } from '@tiptap/vue-3/menus';\nimport { StarterKit } from '@tiptap/starter-kit';\nimport { VUI_WYSIWYG_EDITOR_SYMBOL } from '../../injections';\nimport {\n RawWysiwygExtension,\n resolveRawWysiwygExtensions,\n RawWysiwygEditorTool,\n resolveRawWysiwygEditorTools,\n WysiwygEditorContext,\n // EditorEventsOptions,\n WysiwygEditorInitializeContext,\n} from '../../schema';\n\nconst slots = defineSlots<FormNodeWrapperSlots & InputBoxSlots>();\n\nexport interface VWysiwygEditorAPI {\n readonly editor: Editor | undefined;\n readonly control: TextableControl;\n}\n\nexport const VWysiwygEditor = defineComponent({\n name: 'VWysiwygEditor',\n props: {\n ...createTextableProps(),\n ...createFormNodeWrapperProps(),\n ...createControlFieldProps(),\n ...createControlFieldProviderProps(),\n ...createControlProps(),\n ...slots(),\n extensions: {\n type: Array as PropType<RawWysiwygExtension[]>,\n default: () => [],\n },\n tools: {\n type: Array as PropType<RawWysiwygEditorTool[]>,\n default: () => [],\n },\n floatingToolbar: Boolean,\n disabledMinHeight: Boolean,\n disabledMaxHeight: Boolean,\n removeDefaultWrapper: {\n type: Boolean,\n default: true,\n },\n },\n emits: {\n ...createTextableEmits(),\n },\n slots,\n setup(props, ctx) {\n const vui = useVui();\n\n const textRef = ref('');\n const toolButtonActiveColor = vui.setting('primaryScope');\n\n const wysiwygSettings = computed(() =>\n resolveRawWysiwygEditorTools(props.tools, vui),\n );\n\n const control = useControl(props);\n useControlField(props);\n\n const classes = computed(() => [\n 'v-wysiwyg-editor',\n control.classes.value,\n `v-wysiwyg-editor--${control.size.value}`,\n {\n 'v-wysiwyg-editor--disabled-min-height': props.disabledMinHeight,\n 'v-wysiwyg-editor--disabled-max-height': props.disabledMaxHeight,\n },\n ]);\n\n const inputControl = new TextableControl(props, ctx as any, {\n nodeType: VUI_WYSIWYG_EDITOR_SYMBOL,\n validationValue: () => textRef.value,\n });\n\n const getOutput = (\n editor: Pick<Editor, 'isEmpty' | 'getHTML' | 'getText'>,\n type: 'text' | 'html',\n ) => {\n if (props.removeDefaultWrapper && editor.isEmpty) return '';\n if (type === 'html') return editor.getHTML();\n if (type === 'text') return editor.getText();\n return '';\n };\n\n const initializeCtx = new WysiwygEditorInitializeContext(() => vui, {\n onCreate: ({ editor }) => {\n textRef.value = getOutput(editor, 'text');\n updateEditable();\n },\n onFocus: ({ event }) => {\n inputControl.focusHandler(event);\n },\n onBlur: ({ event }) => {\n inputControl.blurHandler(event);\n },\n onUpdate: ({ editor }) => {\n inputControl.value = getOutput(editor, 'html');\n textRef.value = getOutput(editor, 'text');\n },\n });\n\n const extensions = [\n StarterKit.configure({\n bold: false,\n bulletList: false,\n orderedList: false,\n undoRedo: false,\n italic: false,\n }),\n ...resolveRawWysiwygExtensions(props.extensions, initializeCtx),\n ...wysiwygSettings.value.extensions,\n ];\n\n const updateEditable = () => {\n if (!editor.value) return;\n editor.value.setEditable(inputControl.canOperation);\n };\n\n watch(() => inputControl.canOperation, updateEditable);\n\n watch(\n () => props.modelValue,\n (modelValue) => {\n const $editor = editor.value;\n if (!$editor || getOutput($editor, 'html') === modelValue) return;\n\n $editor.commands.setContent(modelValue == null ? '' : modelValue, {\n emitUpdate: false,\n });\n textRef.value = getOutput($editor, 'text');\n },\n );\n\n initializeCtx.on('create', ({ editor }) => {\n textRef.value = getOutput(editor, 'text');\n updateEditable();\n });\n\n const editor = useEditor({\n ...initializeCtx.editorOptions(),\n autofocus: props.autofocus,\n content: props.modelValue,\n extensions,\n editorProps: {\n attributes: {\n class: 'v-wysiwyg-editor__input__prose',\n },\n },\n });\n\n const focus = (\n position?: FocusPosition,\n options?: {\n scrollIntoView?: boolean | undefined;\n },\n ) => editor.value?.chain().focus(position, options);\n\n const wysiwygContext = computed<WysiwygEditorContext>(() => ({\n vui,\n editor: editor.value!,\n }));\n\n const createTools = (bubbleMenu = false) => {\n const { value: settings } = wysiwygSettings;\n const { value: context } = wysiwygContext;\n const tools = bubbleMenu\n ? settings.tools.filter((t) => !!t.floating)\n : settings.tools;\n const _editor = editor.value;\n const variant = vui.setting(\n bubbleMenu ? 'containedVariant' : 'plainVariant',\n );\n\n return (\n <VButtonGroup\n class={[\n 'v-wysiwyg-editor__toolbar',\n {\n 'v-wysiwyg-editor__floating-toolbar': props.floatingToolbar,\n },\n ]}\n variant={variant}>\n {tools.map(({ key, icon, onClick, disabled, active }) => {\n const isActive =\n !!_editor && resolveContextualValue(context, active);\n const isDisabled =\n !inputControl.canOperation ||\n (!!_editor && resolveContextualValue(context, disabled));\n let iconName: IconName | undefined;\n let child: VNodeChild;\n\n if (typeof icon === 'function') {\n if (_editor) {\n const _child = icon(context);\n if (typeof _child === 'function') {\n child = _child();\n } else {\n iconName = _child;\n }\n }\n } else {\n iconName = icon;\n }\n\n if (!iconName && child == null) return;\n\n return (\n <VButton\n tabindex={-1}\n key={key}\n icon={iconName}\n onClick={(ev) => onClick(context, ev)}\n color={isActive ? toolButtonActiveColor : undefined}\n disabled={isDisabled}>\n {child}\n </VButton>\n );\n })}\n </VButtonGroup>\n );\n };\n\n onBeforeUnmount(() => {\n editor.value?.destroy();\n });\n\n const api: VWysiwygEditorAPI = {\n get editor() {\n return editor.value;\n },\n control: inputControl,\n };\n\n ctx.expose(api);\n\n const handleClickLabel = (ev: PointerEvent) => {\n focus('start', { scrollIntoView: true });\n };\n\n const defaultSlot = () => (\n <div class=\"v-wysiwyg-editor__body\">\n <EditorContent\n class=\"v-wysiwyg-editor__input__element wysiwyg\"\n editor={editor.value}\n />\n {!props.floatingToolbar &&\n !!editor.value &&\n !inputControl.isReadonly && (\n <BubbleMenu editor={editor.value}>\n <div class=\"v-wysiwyg-editor__bubble-menu\">\n {createTools(true)}\n </div>\n </BubbleMenu>\n )}\n </div>\n );\n\n const formControlDefaultSlot = () => (\n <div class=\"v-wysiwyg-editor__wrapper\">\n {!inputControl.isReadonly && createTools()}\n <VControlField\n class=\"v-wysiwyg-editor__input\"\n autoHeight\n startAdornment={props.startAdornment}\n endAdornment={props.endAdornment}\n size={control.size.value}\n v-slots={{\n ...ctx.slots,\n default: withCtx(defaultSlot),\n }}\n />\n </div>\n );\n\n const infoAppendsSlot = () => {\n const { counterResult } = inputControl;\n if (!counterResult) return;\n return <VTextCounter {...counterResult} />;\n };\n\n return () => (\n <VFormControl\n nodeControl={inputControl}\n class={classes.value}\n label={props.label}\n hint={props.hint}\n hinttip={props.hinttip}\n hiddenInfo={props.hiddenInfo}\n requiredChip={props.requiredChip}\n onClickLabel={handleClickLabel}\n v-slots={{\n ...ctx.slots,\n default: withCtx(formControlDefaultSlot),\n infoAppends: withCtx(infoAppendsSlot),\n }}\n />\n );\n },\n});\n\nfunction resolveContextualValue(\n ctx: WysiwygEditorContext,\n source?: boolean | ((ctx: WysiwygEditorContext) => boolean),\n) {\n return typeof source === 'function' ? source(ctx) : source;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAM,qBAAuC,WAC3C,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,OAAO,MAAM,CAAC;AAgBtD,IAAa,iCAAb,MAA4C;CAC1C,YAAgD,CAAC;CAEjD;CAEA,IAAI,MAAM;EACR,OAAO,KAAK,KAAK;CACnB;CAEA,YACE,WACA,OAAmC,CAAC,GACpC;EACA,KAAK,OAAO;EAEZ,cAAc,SAAS,UAAU;GAC/B,KAAK,UAAU,SAAS,CAAC;GAEzB,MAAM,KAAK,KADM,kBAAkB,KACZ;GACvB,MAAM,KAAK,UAAU,MAAM,CAAC,KAAK,EAAS;EAC5C,CAAC;CACH;CAEA,GACE,IACA,SACA;EACA,KAAK,UAAU,GAAG,CAAC,KAAK,OAAO;EAC/B,aAAa,KAAK,IAAI,IAAI,OAAO;CACnC;CAEA,IACE,IACA,SACA;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IAAI,CAAC,eAAe;GACpB,OAAA,YAAA,cAAyB,eAAa,IAAA;EACxC;EAEA,aAAO,YAAA,cAAA;GAAA,eAEU;GAAY,SAClB,QAAQ;GAAK,SACb,MAAM;GAAK,QACZ,MAAM;GAAI,WACP,MAAM;GAAO,cACV,MAAM;GAAU,gBACd,MAAM;GAAY,gBAClB;EAAgB,GACrB;GACP,GAAG,IAAI;GACP,SAAS,QAAQ,sBAAsB;GACvC,aAAa,QAAQ,eAAe;EACtC,CAAC;CAGP;AACF,CAAC;AAED,SAAS,uBACP,KACA,QACA;CACA,OAAO,OAAO,WAAW,aAAa,OAAO,GAAG,IAAI;AACtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastkit/vui-wysiwyg",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.6",
|
|
4
4
|
"description": "vui-wysiwyg",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -257,12 +257,12 @@
|
|
|
257
257
|
"devDependencies": {
|
|
258
258
|
"vue": "^3.5.40",
|
|
259
259
|
"vue-router": "^5.2.0",
|
|
260
|
-
"@fastkit/vui": "^1.
|
|
260
|
+
"@fastkit/vui": "^1.7.0"
|
|
261
261
|
},
|
|
262
262
|
"peerDependencies": {
|
|
263
263
|
"vue": "^3.5.0",
|
|
264
264
|
"vue-router": "^4.4.0 || ^5.0.0",
|
|
265
|
-
"@fastkit/vui": "^1.
|
|
265
|
+
"@fastkit/vui": "^1.7.0"
|
|
266
266
|
},
|
|
267
267
|
"scripts": {
|
|
268
268
|
"build": "plugboy build",
|