@portabletext/plugin-markdown-shortcuts 8.0.44 → 8.0.45
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/index.d.ts +67 -121
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +372 -476
- package/dist/index.js.map +1 -1
- package/package.json +13 -11
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/behavior.markdown-shortcuts.ts","../src/rule.blockquote.ts","../src/rule.heading.ts","../src/rule.horizontal-rule.ts","../src/rule.markdown-link.ts","../src/rule.ordered-list.ts","../src/rule.unordered-list.ts","../src/plugin.markdown-shortcuts.tsx"],"sourcesContent":["import type {EditorContext} from '@portabletext/editor'\nimport {defineBehavior, raise} from '@portabletext/editor/behaviors'\nimport * as selectors from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\n\nexport type ObjectWithOptionalKey = {\n _type: string\n _key?: string\n [other: string]: unknown\n}\n\nexport type MarkdownBehaviorsConfig = {\n horizontalRuleObject?: ({\n context,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n }) => ObjectWithOptionalKey | undefined\n defaultStyle?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}\n\nexport function createMarkdownBehaviors(config: MarkdownBehaviorsConfig) {\n const automaticHrOnPaste = defineBehavior({\n on: 'clipboard.paste',\n guard: ({snapshot, event}) => {\n const text = event.originEvent.dataTransfer.getData('text/plain')\n const hrRegExp = /^(---)$|^(—-)$|^(___)$|^(\\*\\*\\*)$/\n const hrCharacters = text.match(hrRegExp)?.[0]\n const focusBlock = selectors.getFocusBlock(snapshot)\n const focusTextBlock = selectors.getFocusTextBlock(snapshot)\n\n if (!focusBlock) {\n return false\n }\n\n const hrObject = config.horizontalRuleObject?.({\n context: {\n schema: getPathSubSchema(snapshot, focusBlock.path),\n keyGenerator: snapshot.context.keyGenerator,\n },\n })\n\n if (!hrCharacters || !hrObject) {\n return false\n }\n\n return {hrCharacters, hrObject, focusBlock, focusTextBlock}\n },\n actions: [\n (_, {hrCharacters}) => [\n raise({\n type: 'insert.text',\n text: hrCharacters,\n }),\n ],\n ({snapshot}, {hrObject, focusBlock, focusTextBlock}) =>\n focusTextBlock\n ? [\n raise({\n type: 'insert.block',\n block: {\n _type: snapshot.context.schema.block.name,\n children: focusTextBlock.node.children,\n },\n placement: 'after',\n }),\n raise({\n type: 'insert.block',\n block: hrObject,\n placement: 'after',\n }),\n raise({\n type: 'delete.block',\n at: focusBlock.path,\n }),\n ]\n : [\n raise({\n type: 'insert.block',\n block: hrObject,\n placement: 'after',\n }),\n ],\n ],\n })\n\n const clearStyleOnBackspace = defineBehavior({\n on: 'delete.backward',\n guard: ({snapshot}) => {\n const selectionCollapsed = selectors.isSelectionCollapsed(snapshot)\n const focusTextBlock = selectors.getFocusTextBlock(snapshot)\n const focusSpan = selectors.getFocusSpan(snapshot)\n\n if (!selectionCollapsed || !focusTextBlock || !focusSpan) {\n return false\n }\n\n const atTheBeginningOfBLock =\n focusTextBlock.node.children[0]._key === focusSpan.node._key &&\n snapshot.context.selection?.focus.offset === 0\n\n if (!atTheBeginningOfBLock) {\n // A style can only clear at the start of the block; resolving the\n // sub-schema and calling the consumer's `defaultStyle` callback on\n // every other backspace is wasted work with a consumer-visible\n // call frequency.\n return false\n }\n\n const subSchema = getPathSubSchema(snapshot, focusTextBlock.path)\n const defaultStyle = config.defaultStyle?.({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (defaultStyle && focusTextBlock.node.style !== defaultStyle) {\n return {defaultStyle, focusTextBlock}\n }\n\n return false\n },\n actions: [\n (_, {defaultStyle, focusTextBlock}) => [\n raise({\n type: 'block.set',\n props: {style: defaultStyle},\n at: focusTextBlock.path,\n }),\n ],\n ],\n })\n\n const markdownBehaviors = [automaticHrOnPaste, clearStyleOnBackspace]\n\n return markdownBehaviors\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createBlockquoteRule(config: {\n blockquoteStyle: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^> /,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const style = config.blockquoteStyle({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (!style) {\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {style, match}\n },\n actions: [\n ({event}, {style, match}) => [\n raise({\n type: 'block.unset',\n props: ['listItem', 'level'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {style},\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createHeadingRule(config: {\n headingStyle: ({\n context,\n schema,\n props,\n level,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n props: {level: number}\n /**\n * @deprecated Use `props.level` instead\n */\n level: number\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^#+ /,\n guard: ({snapshot, event}) => {\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n const level = match.text.length - 1\n\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const style = config.headingStyle({\n context: {schema: subSchema},\n schema: subSchema,\n props: {level},\n level,\n })\n\n if (!style) {\n return false\n }\n\n return {match, style}\n },\n actions: [\n ({event}, {match, style}) => [\n raise({\n type: 'block.unset',\n props: ['listItem', 'level'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {style},\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\nimport type {ObjectWithOptionalKey} from './behavior.markdown-shortcuts'\n\nexport function createHorizontalRuleRule(config: {\n horizontalRuleObject: ({\n context,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n }) => ObjectWithOptionalKey | undefined\n}) {\n return defineInputRule({\n on: /^(---)|^(—-)|^(___)|^(\\*\\*\\*)/,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const hrObject = config.horizontalRuleObject({\n context: {\n schema: subSchema,\n keyGenerator: snapshot.context.keyGenerator,\n },\n })\n\n if (!hrObject) {\n // If no horizontal rule object is provided, then we can safely skip\n // this rule.\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n // Input Rules only look at the plain text of the text block. This\n // means that the RegExp is matched even if there is a leading inline\n // object.\n return false\n }\n\n // In theory, an Input Rule could return multiple matches. But in this\n // case we only expect one match.\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {hrObject, match}\n },\n actions: [\n (_, {hrObject, match}) => [\n raise({\n type: 'insert.block',\n block: hrObject,\n placement: 'before',\n select: 'none',\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise, type BehaviorAction} from '@portabletext/editor/behaviors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\nimport type {ObjectWithOptionalKey} from './behavior.markdown-shortcuts'\n\nexport function createMarkdownLinkRule(config: {\n linkObject: ({\n context,\n props,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n props: {href: string}\n }) => ObjectWithOptionalKey | undefined\n}) {\n return defineInputRule({\n on: /\\[(?<text>[^[\\]]+)]\\((?<href>.+)\\)/,\n // The rule annotates the text and deletes only the markers and the href\n // region, so an inline object inside the link TEXT is harmless and the\n // link must fire. The unlisted `href` group stays protected: deleting\n // `](href)` across an inline object would destroy it, and the captured\n // href text would silently omit it.\n inlineObjects: {allow: ['text']},\n actions: [\n ({snapshot, event}) => {\n const newText = event.textBefore + event.textInserted\n let textLengthDelta = 0\n const actions: Array<BehaviorAction> = []\n\n for (const match of event.matches.reverse()) {\n const textMatch = match.groups['text']\n const hrefMatch = match.groups['href']\n\n if (textMatch === undefined || hrefMatch === undefined) {\n continue\n }\n\n textLengthDelta =\n textLengthDelta -\n (match.targetOffsets.focus.offset -\n match.targetOffsets.anchor.offset -\n textMatch.text.length)\n\n const linkObject = config.linkObject({\n context: {\n schema: getPathSubSchema(snapshot, event.focusBlock.path),\n keyGenerator: snapshot.context.keyGenerator,\n },\n props: {href: hrefMatch.text},\n })\n\n if (!linkObject) {\n continue\n }\n\n const {_type, _key, ...value} = linkObject\n\n const leftSideOffsets = {\n anchor: match.targetOffsets.anchor,\n focus: textMatch.targetOffsets.anchor,\n }\n const rightSideOffsets = {\n anchor: textMatch.targetOffsets.focus,\n focus: match.targetOffsets.focus,\n }\n\n actions.push(\n raise({\n type: 'select',\n at: textMatch.targetOffsets,\n }),\n )\n actions.push(\n raise({\n type: 'annotation.add',\n annotation: {\n name: _type,\n _key,\n value,\n },\n }),\n )\n actions.push(\n raise({\n type: 'delete',\n at: rightSideOffsets,\n }),\n )\n actions.push(\n raise({\n type: 'delete',\n at: leftSideOffsets,\n }),\n )\n }\n\n if (actions.length === 0) {\n return []\n }\n\n const endCaretPosition = {\n path: event.focusBlock.path,\n offset: newText.length - textLengthDelta * -1,\n }\n\n return [\n ...actions,\n raise({\n type: 'select',\n at: {\n anchor: endCaretPosition,\n focus: endCaretPosition,\n },\n }),\n ]\n },\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createOrderedListRule(config: {\n orderedList: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^1\\. /,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const orderedList = config.orderedList({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (!orderedList) {\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {match, orderedList}\n },\n actions: [\n ({event}, {match, orderedList}) => [\n raise({\n type: 'block.unset',\n props: ['style'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {\n listItem: orderedList,\n level: event.focusBlock.node.level ?? 1,\n },\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createUnorderedListRule(config: {\n unorderedList: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^(-|\\*) /,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const unorderedList = config.unorderedList({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (!unorderedList) {\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {match, unorderedList}\n },\n actions: [\n ({event}, {match, unorderedList}) => [\n raise({\n type: 'block.unset',\n props: ['style'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {\n listItem: unorderedList,\n level: event.focusBlock.node.level ?? 1,\n },\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {useEditor} from '@portabletext/editor'\nimport {CharacterPairDecoratorPlugin} from '@portabletext/plugin-character-pair-decorator'\nimport {InputRulePlugin} from '@portabletext/plugin-input-rule'\nimport {useEffect, useMemo} from 'react'\nimport {\n createMarkdownBehaviors,\n type MarkdownBehaviorsConfig,\n type ObjectWithOptionalKey,\n} from './behavior.markdown-shortcuts'\nimport {createBlockquoteRule} from './rule.blockquote'\nimport {createHeadingRule} from './rule.heading'\nimport {createHorizontalRuleRule} from './rule.horizontal-rule'\nimport {createMarkdownLinkRule} from './rule.markdown-link'\nimport {createOrderedListRule} from './rule.ordered-list'\nimport {createUnorderedListRule} from './rule.unordered-list'\n\n/**\n * @public\n */\nexport type MarkdownShortcutsPluginProps = MarkdownBehaviorsConfig & {\n blockquoteStyle?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n defaultStyle?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n headingStyle?: ({\n context,\n schema,\n props,\n level,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n props: {level: number}\n /**\n * @deprecated Use `props.level` instead\n */\n level: number\n }) => string | undefined\n linkObject?: ({\n context,\n props,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n props: {href: string}\n }) => ObjectWithOptionalKey | undefined\n unorderedList?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n orderedList?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n boldDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n codeDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n italicDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n strikeThroughDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}\n\n/**\n * @public\n */\nexport function MarkdownShortcutsPlugin({\n blockquoteStyle,\n boldDecorator,\n codeDecorator,\n defaultStyle,\n headingStyle,\n horizontalRuleObject,\n linkObject,\n italicDecorator,\n orderedList,\n strikeThroughDecorator,\n unorderedList,\n}: MarkdownShortcutsPluginProps) {\n const editor = useEditor()\n\n useEffect(() => {\n const behaviors = createMarkdownBehaviors({\n defaultStyle,\n })\n\n const unregisterBehaviors = behaviors.map((behavior) =>\n editor.registerBehavior({behavior}),\n )\n\n return () => {\n for (const unregisterBehavior of unregisterBehaviors) {\n unregisterBehavior()\n }\n }\n }, [defaultStyle, editor])\n\n const inputRules = useMemo(() => {\n const rules = []\n if (blockquoteStyle) {\n rules.push(createBlockquoteRule({blockquoteStyle}))\n }\n if (headingStyle) {\n rules.push(createHeadingRule({headingStyle}))\n }\n if (horizontalRuleObject) {\n rules.push(createHorizontalRuleRule({horizontalRuleObject}))\n }\n if (linkObject) {\n rules.push(createMarkdownLinkRule({linkObject}))\n }\n if (orderedList) {\n rules.push(createOrderedListRule({orderedList}))\n }\n if (unorderedList) {\n rules.push(createUnorderedListRule({unorderedList}))\n }\n return rules.length > 0 ? rules : null\n }, [\n blockquoteStyle,\n headingStyle,\n horizontalRuleObject,\n linkObject,\n orderedList,\n unorderedList,\n ])\n\n return (\n <>\n {boldDecorator ? (\n <>\n <CharacterPairDecoratorPlugin\n decorator={boldDecorator}\n pair={{char: '*', amount: 2}}\n />\n <CharacterPairDecoratorPlugin\n decorator={boldDecorator}\n pair={{char: '_', amount: 2}}\n />\n </>\n ) : null}\n {codeDecorator ? (\n <CharacterPairDecoratorPlugin\n decorator={codeDecorator}\n pair={{char: '`', amount: 1}}\n />\n ) : null}\n {italicDecorator ? (\n <>\n <CharacterPairDecoratorPlugin\n decorator={italicDecorator}\n pair={{char: '*', amount: 1}}\n />\n <CharacterPairDecoratorPlugin\n decorator={italicDecorator}\n pair={{char: '_', amount: 1}}\n />\n </>\n ) : null}\n {strikeThroughDecorator ? (\n <CharacterPairDecoratorPlugin\n decorator={strikeThroughDecorator}\n pair={{char: '~', amount: 2}}\n />\n ) : null}\n {inputRules ? <InputRulePlugin rules={inputRules} /> : null}\n </>\n )\n}\n"],"names":["createMarkdownBehaviors","config","automaticHrOnPaste","defineBehavior","on","guard","snapshot","event","text","originEvent","dataTransfer","getData","hrRegExp","hrCharacters","match","focusBlock","selectors","getFocusBlock","focusTextBlock","getFocusTextBlock","hrObject","horizontalRuleObject","context","schema","getPathSubSchema","path","keyGenerator","actions","_","raise","type","block","_type","name","children","node","placement","at","clearStyleOnBackspace","selectionCollapsed","isSelectionCollapsed","focusSpan","getFocusSpan","_key","selection","focus","offset","subSchema","defaultStyle","style","props","createBlockquoteRule","defineInputRule","blockquoteStyle","getPreviousInlineObject","matches","targetOffsets","createHeadingRule","level","length","headingStyle","createHorizontalRuleRule","select","createMarkdownLinkRule","inlineObjects","allow","newText","textBefore","textInserted","textLengthDelta","reverse","textMatch","groups","hrefMatch","undefined","anchor","linkObject","href","value","leftSideOffsets","rightSideOffsets","push","annotation","endCaretPosition","createOrderedListRule","orderedList","listItem","createUnorderedListRule","unorderedList","MarkdownShortcutsPlugin","t0","$","_c","boldDecorator","codeDecorator","italicDecorator","strikeThroughDecorator","editor","useEditor","t1","t2","unregisterBehaviors","map","behavior","registerBehavior","unregisterBehavior","useEffect","rules","t3","inputRules","char","amount","t4","t5","t6","t7","t8"],"mappings":";;;;;;;;;;AA6BO,SAASA,wBAAwBC,QAAiC;AACvE,QAAMC,qBAAqBC,eAAe;AAAA,IACxCC,IAAI;AAAA,IACJC,OAAOA,CAAC;AAAA,MAACC;AAAAA,MAAUC;AAAAA,IAAAA,MAAW;AAC5B,YAAMC,OAAOD,MAAME,YAAYC,aAAaC,QAAQ,YAAY,GAC1DC,WAAW,qCACXC,eAAeL,KAAKM,MAAMF,QAAQ,IAAI,CAAC,GACvCG,aAAaC,UAAUC,cAAcX,QAAQ,GAC7CY,iBAAiBF,UAA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AtCHyB;AAsCG;"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["EditorContext","defineBehavior","raise","selectors","getPathSubSchema","ObjectWithOptionalKey","_type","_key","other","MarkdownBehaviorsConfig","horizontalRuleObject","context","Pick","defaultStyle","schema","createMarkdownBehaviors","config","automaticHrOnPaste","on","guard","snapshot","event","text","originEvent","dataTransfer","getData","hrRegExp","hrCharacters","match","focusBlock","getFocusBlock","focusTextBlock","getFocusTextBlock","hrObject","path","keyGenerator","actions","_","type","block","name","children","node","placement","at","clearStyleOnBackspace","selectionCollapsed","isSelectionCollapsed","focusSpan","getFocusSpan","atTheBeginningOfBLock","selection","focus","offset","subSchema","style","props","markdownBehaviors","EditorContext","raise","getPreviousInlineObject","getPathSubSchema","defineInputRule","createBlockquoteRule","config","blockquoteStyle","context","schema","Pick","on","guard","snapshot","event","subSchema","focusBlock","path","style","previousInlineObject","match","matches","at","actions","type","props","targetOffsets","EditorContext","raise","getPreviousInlineObject","getPathSubSchema","defineInputRule","createHeadingRule","config","headingStyle","context","schema","props","level","Pick","on","guard","snapshot","event","previousInlineObject","match","matches","at","text","length","subSchema","focusBlock","path","style","actions","type","targetOffsets","EditorContext","raise","getPreviousInlineObject","getPathSubSchema","defineInputRule","ObjectWithOptionalKey","createHorizontalRuleRule","config","horizontalRuleObject","context","Pick","on","guard","snapshot","event","subSchema","focusBlock","path","hrObject","schema","keyGenerator","previousInlineObject","match","matches","at","actions","_","type","block","placement","select","targetOffsets","EditorContext","raise","BehaviorAction","getPathSubSchema","defineInputRule","ObjectWithOptionalKey","createMarkdownLinkRule","config","linkObject","context","props","Pick","href","on","inlineObjects","allow","actions","snapshot","event","newText","textBefore","textInserted","textLengthDelta","Array","match","matches","reverse","textMatch","groups","hrefMatch","undefined","targetOffsets","focus","offset","anchor","text","length","schema","focusBlock","path","keyGenerator","_type","_key","value","leftSideOffsets","rightSideOffsets","push","type","at","annotation","name","endCaretPosition","EditorContext","raise","getPreviousInlineObject","getPathSubSchema","defineInputRule","createOrderedListRule","config","orderedList","context","schema","Pick","on","guard","snapshot","event","subSchema","focusBlock","path","previousInlineObject","match","matches","at","actions","type","props","listItem","level","node","targetOffsets","EditorContext","raise","getPreviousInlineObject","getPathSubSchema","defineInputRule","createUnorderedListRule","config","unorderedList","context","schema","Pick","on","guard","snapshot","event","subSchema","focusBlock","path","previousInlineObject","match","matches","at","actions","type","props","listItem","level","node","targetOffsets","EditorContext","useEditor","CharacterPairDecoratorPlugin","InputRulePlugin","useEffect","useMemo","createMarkdownBehaviors","MarkdownBehaviorsConfig","ObjectWithOptionalKey","createBlockquoteRule","createHeadingRule","createHorizontalRuleRule","createMarkdownLinkRule","createOrderedListRule","createUnorderedListRule","MarkdownShortcutsPluginProps","blockquoteStyle","context","schema","Pick","defaultStyle","headingStyle","props","level","linkObject","href","unorderedList","orderedList","boldDecorator","codeDecorator","italicDecorator","strikeThroughDecorator","MarkdownShortcutsPlugin","t0","$","_c","horizontalRuleObject","editor","t1","t2","behaviors","unregisterBehaviors","map","behavior","registerBehavior","unregisterBehavior","rules","t3","push","inputRules","length","char","amount","t4","t5","t6","t7","t8"],"sources":["../src/behavior.markdown-shortcuts.ts","../src/rule.blockquote.ts","../src/rule.heading.ts","../src/rule.horizontal-rule.ts","../src/rule.markdown-link.ts","../src/rule.ordered-list.ts","../src/rule.unordered-list.ts","../src/plugin.markdown-shortcuts.tsx"],"sourcesContent":["import type {EditorContext} from '@portabletext/editor'\nimport {defineBehavior, raise} from '@portabletext/editor/behaviors'\nimport * as selectors from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\n\nexport type ObjectWithOptionalKey = {\n _type: string\n _key?: string\n [other: string]: unknown\n}\n\nexport type MarkdownBehaviorsConfig = {\n horizontalRuleObject?: ({\n context,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n }) => ObjectWithOptionalKey | undefined\n defaultStyle?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}\n\nexport function createMarkdownBehaviors(config: MarkdownBehaviorsConfig) {\n const automaticHrOnPaste = defineBehavior({\n on: 'clipboard.paste',\n guard: ({snapshot, event}) => {\n const text = event.originEvent.dataTransfer.getData('text/plain')\n const hrRegExp = /^(---)$|^(—-)$|^(___)$|^(\\*\\*\\*)$/\n const hrCharacters = text.match(hrRegExp)?.[0]\n const focusBlock = selectors.getFocusBlock(snapshot)\n const focusTextBlock = selectors.getFocusTextBlock(snapshot)\n\n if (!focusBlock) {\n return false\n }\n\n const hrObject = config.horizontalRuleObject?.({\n context: {\n schema: getPathSubSchema(snapshot, focusBlock.path),\n keyGenerator: snapshot.context.keyGenerator,\n },\n })\n\n if (!hrCharacters || !hrObject) {\n return false\n }\n\n return {hrCharacters, hrObject, focusBlock, focusTextBlock}\n },\n actions: [\n (_, {hrCharacters}) => [\n raise({\n type: 'insert.text',\n text: hrCharacters,\n }),\n ],\n ({snapshot}, {hrObject, focusBlock, focusTextBlock}) =>\n focusTextBlock\n ? [\n raise({\n type: 'insert.block',\n block: {\n _type: snapshot.context.schema.block.name,\n children: focusTextBlock.node.children,\n },\n placement: 'after',\n }),\n raise({\n type: 'insert.block',\n block: hrObject,\n placement: 'after',\n }),\n raise({\n type: 'delete.block',\n at: focusBlock.path,\n }),\n ]\n : [\n raise({\n type: 'insert.block',\n block: hrObject,\n placement: 'after',\n }),\n ],\n ],\n })\n\n const clearStyleOnBackspace = defineBehavior({\n on: 'delete.backward',\n guard: ({snapshot}) => {\n const selectionCollapsed = selectors.isSelectionCollapsed(snapshot)\n const focusTextBlock = selectors.getFocusTextBlock(snapshot)\n const focusSpan = selectors.getFocusSpan(snapshot)\n\n if (!selectionCollapsed || !focusTextBlock || !focusSpan) {\n return false\n }\n\n const atTheBeginningOfBLock =\n focusTextBlock.node.children[0]._key === focusSpan.node._key &&\n snapshot.context.selection?.focus.offset === 0\n\n if (!atTheBeginningOfBLock) {\n // A style can only clear at the start of the block; resolving the\n // sub-schema and calling the consumer's `defaultStyle` callback on\n // every other backspace is wasted work with a consumer-visible\n // call frequency.\n return false\n }\n\n const subSchema = getPathSubSchema(snapshot, focusTextBlock.path)\n const defaultStyle = config.defaultStyle?.({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (defaultStyle && focusTextBlock.node.style !== defaultStyle) {\n return {defaultStyle, focusTextBlock}\n }\n\n return false\n },\n actions: [\n (_, {defaultStyle, focusTextBlock}) => [\n raise({\n type: 'block.set',\n props: {style: defaultStyle},\n at: focusTextBlock.path,\n }),\n ],\n ],\n })\n\n const markdownBehaviors = [automaticHrOnPaste, clearStyleOnBackspace]\n\n return markdownBehaviors\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createBlockquoteRule(config: {\n blockquoteStyle: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^> /,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const style = config.blockquoteStyle({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (!style) {\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {style, match}\n },\n actions: [\n ({event}, {style, match}) => [\n raise({\n type: 'block.unset',\n props: ['listItem', 'level'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {style},\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createHeadingRule(config: {\n headingStyle: ({\n context,\n schema,\n props,\n level,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n props: {level: number}\n /**\n * @deprecated Use `props.level` instead\n */\n level: number\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^#+ /,\n guard: ({snapshot, event}) => {\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n const level = match.text.length - 1\n\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const style = config.headingStyle({\n context: {schema: subSchema},\n schema: subSchema,\n props: {level},\n level,\n })\n\n if (!style) {\n return false\n }\n\n return {match, style}\n },\n actions: [\n ({event}, {match, style}) => [\n raise({\n type: 'block.unset',\n props: ['listItem', 'level'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {style},\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\nimport type {ObjectWithOptionalKey} from './behavior.markdown-shortcuts'\n\nexport function createHorizontalRuleRule(config: {\n horizontalRuleObject: ({\n context,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n }) => ObjectWithOptionalKey | undefined\n}) {\n return defineInputRule({\n on: /^(---)|^(—-)|^(___)|^(\\*\\*\\*)/,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const hrObject = config.horizontalRuleObject({\n context: {\n schema: subSchema,\n keyGenerator: snapshot.context.keyGenerator,\n },\n })\n\n if (!hrObject) {\n // If no horizontal rule object is provided, then we can safely skip\n // this rule.\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n // Input Rules only look at the plain text of the text block. This\n // means that the RegExp is matched even if there is a leading inline\n // object.\n return false\n }\n\n // In theory, an Input Rule could return multiple matches. But in this\n // case we only expect one match.\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {hrObject, match}\n },\n actions: [\n (_, {hrObject, match}) => [\n raise({\n type: 'insert.block',\n block: hrObject,\n placement: 'before',\n select: 'none',\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise, type BehaviorAction} from '@portabletext/editor/behaviors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\nimport type {ObjectWithOptionalKey} from './behavior.markdown-shortcuts'\n\nexport function createMarkdownLinkRule(config: {\n linkObject: ({\n context,\n props,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n props: {href: string}\n }) => ObjectWithOptionalKey | undefined\n}) {\n return defineInputRule({\n on: /\\[(?<text>[^[\\]]+)]\\((?<href>.+)\\)/,\n // The rule annotates the text and deletes only the markers and the href\n // region, so an inline object inside the link TEXT is harmless and the\n // link must fire. The unlisted `href` group stays protected: deleting\n // `](href)` across an inline object would destroy it, and the captured\n // href text would silently omit it.\n inlineObjects: {allow: ['text']},\n actions: [\n ({snapshot, event}) => {\n const newText = event.textBefore + event.textInserted\n let textLengthDelta = 0\n const actions: Array<BehaviorAction> = []\n\n for (const match of event.matches.reverse()) {\n const textMatch = match.groups['text']\n const hrefMatch = match.groups['href']\n\n if (textMatch === undefined || hrefMatch === undefined) {\n continue\n }\n\n textLengthDelta =\n textLengthDelta -\n (match.targetOffsets.focus.offset -\n match.targetOffsets.anchor.offset -\n textMatch.text.length)\n\n const linkObject = config.linkObject({\n context: {\n schema: getPathSubSchema(snapshot, event.focusBlock.path),\n keyGenerator: snapshot.context.keyGenerator,\n },\n props: {href: hrefMatch.text},\n })\n\n if (!linkObject) {\n continue\n }\n\n const {_type, _key, ...value} = linkObject\n\n const leftSideOffsets = {\n anchor: match.targetOffsets.anchor,\n focus: textMatch.targetOffsets.anchor,\n }\n const rightSideOffsets = {\n anchor: textMatch.targetOffsets.focus,\n focus: match.targetOffsets.focus,\n }\n\n actions.push(\n raise({\n type: 'select',\n at: textMatch.targetOffsets,\n }),\n )\n actions.push(\n raise({\n type: 'annotation.add',\n annotation: {\n name: _type,\n _key,\n value,\n },\n }),\n )\n actions.push(\n raise({\n type: 'delete',\n at: rightSideOffsets,\n }),\n )\n actions.push(\n raise({\n type: 'delete',\n at: leftSideOffsets,\n }),\n )\n }\n\n if (actions.length === 0) {\n return []\n }\n\n const endCaretPosition = {\n path: event.focusBlock.path,\n offset: newText.length - textLengthDelta * -1,\n }\n\n return [\n ...actions,\n raise({\n type: 'select',\n at: {\n anchor: endCaretPosition,\n focus: endCaretPosition,\n },\n }),\n ]\n },\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createOrderedListRule(config: {\n orderedList: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^1\\. /,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const orderedList = config.orderedList({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (!orderedList) {\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {match, orderedList}\n },\n actions: [\n ({event}, {match, orderedList}) => [\n raise({\n type: 'block.unset',\n props: ['style'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {\n listItem: orderedList,\n level: event.focusBlock.node.level ?? 1,\n },\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {raise} from '@portabletext/editor/behaviors'\nimport {getPreviousInlineObject} from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {defineInputRule} from '@portabletext/plugin-input-rule'\n\nexport function createUnorderedListRule(config: {\n unorderedList: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}) {\n return defineInputRule({\n on: /^(-|\\*) /,\n guard: ({snapshot, event}) => {\n const subSchema = getPathSubSchema(snapshot, event.focusBlock.path)\n const unorderedList = config.unorderedList({\n context: {schema: subSchema},\n schema: subSchema,\n })\n\n if (!unorderedList) {\n return false\n }\n\n const previousInlineObject = getPreviousInlineObject(snapshot)\n\n if (previousInlineObject) {\n return false\n }\n\n const match = event.matches.at(0)\n\n if (!match) {\n return false\n }\n\n return {match, unorderedList}\n },\n actions: [\n ({event}, {match, unorderedList}) => [\n raise({\n type: 'block.unset',\n props: ['style'],\n at: event.focusBlock.path,\n }),\n raise({\n type: 'block.set',\n props: {\n listItem: unorderedList,\n level: event.focusBlock.node.level ?? 1,\n },\n at: event.focusBlock.path,\n }),\n raise({\n type: 'delete',\n at: match.targetOffsets,\n }),\n ],\n ],\n })\n}\n","import type {EditorContext} from '@portabletext/editor'\nimport {useEditor} from '@portabletext/editor'\nimport {CharacterPairDecoratorPlugin} from '@portabletext/plugin-character-pair-decorator'\nimport {InputRulePlugin} from '@portabletext/plugin-input-rule'\nimport {useEffect, useMemo} from 'react'\nimport {\n createMarkdownBehaviors,\n type MarkdownBehaviorsConfig,\n type ObjectWithOptionalKey,\n} from './behavior.markdown-shortcuts'\nimport {createBlockquoteRule} from './rule.blockquote'\nimport {createHeadingRule} from './rule.heading'\nimport {createHorizontalRuleRule} from './rule.horizontal-rule'\nimport {createMarkdownLinkRule} from './rule.markdown-link'\nimport {createOrderedListRule} from './rule.ordered-list'\nimport {createUnorderedListRule} from './rule.unordered-list'\n\n/**\n * @public\n */\nexport type MarkdownShortcutsPluginProps = MarkdownBehaviorsConfig & {\n blockquoteStyle?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n defaultStyle?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n headingStyle?: ({\n context,\n schema,\n props,\n level,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n props: {level: number}\n /**\n * @deprecated Use `props.level` instead\n */\n level: number\n }) => string | undefined\n linkObject?: ({\n context,\n props,\n }: {\n context: Pick<EditorContext, 'schema' | 'keyGenerator'>\n props: {href: string}\n }) => ObjectWithOptionalKey | undefined\n unorderedList?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n orderedList?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n boldDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n codeDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n italicDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n strikeThroughDecorator?: ({\n context,\n schema,\n }: {\n context: Pick<EditorContext, 'schema'>\n /**\n * @deprecated Use `context.schema` instead\n */\n schema: EditorContext['schema']\n }) => string | undefined\n}\n\n/**\n * @public\n */\nexport function MarkdownShortcutsPlugin({\n blockquoteStyle,\n boldDecorator,\n codeDecorator,\n defaultStyle,\n headingStyle,\n horizontalRuleObject,\n linkObject,\n italicDecorator,\n orderedList,\n strikeThroughDecorator,\n unorderedList,\n}: MarkdownShortcutsPluginProps) {\n const editor = useEditor()\n\n useEffect(() => {\n const behaviors = createMarkdownBehaviors({\n defaultStyle,\n })\n\n const unregisterBehaviors = behaviors.map((behavior) =>\n editor.registerBehavior({behavior}),\n )\n\n return () => {\n for (const unregisterBehavior of unregisterBehaviors) {\n unregisterBehavior()\n }\n }\n }, [defaultStyle, editor])\n\n const inputRules = useMemo(() => {\n const rules = []\n if (blockquoteStyle) {\n rules.push(createBlockquoteRule({blockquoteStyle}))\n }\n if (headingStyle) {\n rules.push(createHeadingRule({headingStyle}))\n }\n if (horizontalRuleObject) {\n rules.push(createHorizontalRuleRule({horizontalRuleObject}))\n }\n if (linkObject) {\n rules.push(createMarkdownLinkRule({linkObject}))\n }\n if (orderedList) {\n rules.push(createOrderedListRule({orderedList}))\n }\n if (unorderedList) {\n rules.push(createUnorderedListRule({unorderedList}))\n }\n return rules.length > 0 ? rules : null\n }, [\n blockquoteStyle,\n headingStyle,\n horizontalRuleObject,\n linkObject,\n orderedList,\n unorderedList,\n ])\n\n return (\n <>\n {boldDecorator ? (\n <>\n <CharacterPairDecoratorPlugin\n decorator={boldDecorator}\n pair={{char: '*', amount: 2}}\n />\n <CharacterPairDecoratorPlugin\n decorator={boldDecorator}\n pair={{char: '_', amount: 2}}\n />\n </>\n ) : null}\n {codeDecorator ? (\n <CharacterPairDecoratorPlugin\n decorator={codeDecorator}\n pair={{char: '`', amount: 1}}\n />\n ) : null}\n {italicDecorator ? (\n <>\n <CharacterPairDecoratorPlugin\n decorator={italicDecorator}\n pair={{char: '*', amount: 1}}\n />\n <CharacterPairDecoratorPlugin\n decorator={italicDecorator}\n pair={{char: '_', amount: 1}}\n />\n </>\n ) : null}\n {strikeThroughDecorator ? (\n <CharacterPairDecoratorPlugin\n decorator={strikeThroughDecorator}\n pair={{char: '~', amount: 2}}\n />\n ) : null}\n {inputRules ? <InputRulePlugin rules={inputRules} /> : null}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAgBe,wBAAwBC,QAAiC;CAiHvE,OAAOyC,CAhHoBxD,eAAe;EACxCiB,IAAI;EACJC,QAAQ,EAACC,UAAUC,YAAW;GAG5B,IAAMM,eAFON,MAAME,YAAYC,aAAaC,QAAQ,YAE/BH,CAAI,CAACM,MAAMF,mCAAQ,CAAC,GAAG,IACtCG,aAAa1B,UAAU2B,cAAcV,QAAQ,GAC7CW,iBAAiB5B,UAAU6B,kBAAkBZ,QAAQ;GAE3D,IAAI,CAACS,YACH,OAAO;GAGT,IAAMI,WAAWjB,OAAON,uBAAuB,EAC7CC,SAAS;IACPG,QAAQV,iBAAiBgB,UAAUS,WAAWK,IAAI;IAClDC,cAAcf,SAAST,QAAQwB;GACjC,EACF,CAAC;GAMD,OAJI,CAACR,gBAAgB,CAACM,WACb,KAGF;IAACN;IAAcM;IAAUJ;IAAYE;GAAc;EAC5D;EACAK,SAAS,EACNC,GAAG,EAACV,mBAAkB,CACrBzB,MAAM;GACJoC,MAAM;GACNhB,MAAMK;EACR,CAAC,CAAC,IAEH,EAACP,YAAW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AU;EAAC;CAAC,CAAA,IAH/B,MAKOlB,EAAA,MAAAH,wBAAAG,EAAA,MAAAqB;CAAA,IAAAC;CAAA,AAAAtB,EAAA,QAAAe,aACmDO,KAAAtB,EAAA,OAA1DsB,KAAAP,aAAa,oBAAC,iBAAD,EAAwBA,OAAAA,WAAU,CAAA,IAA/C,MAA0Df,EAAA,MAAAe,YAAAf,EAAA,MAAAsB;CAAA,IAAAC;CAC1D,OAD0DvB,EAAA,QAAAa,MAAAb,EAAA,QAAAmB,MAAAnB,EAAA,QAAAoB,MAAApB,EAAA,QAAAqB,MAAArB,EAAA,QAAAsB,MArC7DC,KAAA,qBAAA,UAAA,EAAA,UAAA;EACGV;EAYAM;EAMAC;EAYAC;EAMAC;CAA0D,EAAA,CAAA,GAC1DtB,EAAA,MAAAa,IAAAb,EAAA,MAAAmB,IAAAnB,EAAA,MAAAoB,IAAApB,EAAA,MAAAqB,IAAArB,EAAA,MAAAsB,IAAAtB,EAAA,MAAAuB,MAAAA,KAAAvB,EAAA,KAtCHuB;AAsCG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portabletext/plugin-markdown-shortcuts",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.45",
|
|
4
4
|
"description": "Add helpful Markdown shortcuts to the editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"behaviors",
|
|
@@ -26,20 +26,22 @@
|
|
|
26
26
|
"type": "module",
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
29
30
|
"types": "./dist/index.d.ts",
|
|
30
31
|
"exports": {
|
|
31
32
|
".": "./dist/index.js",
|
|
32
33
|
"./package.json": "./package.json"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@portabletext/plugin-character-pair-decorator": "^8.0.
|
|
36
|
-
"@portabletext/plugin-input-rule": "^6.0.
|
|
36
|
+
"@portabletext/plugin-character-pair-decorator": "^8.0.45",
|
|
37
|
+
"@portabletext/plugin-input-rule": "^6.0.14"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
41
|
+
"@sanity/pkg-utils": "^12.1.0",
|
|
40
42
|
"@sanity/tsconfig": "^2.1.0",
|
|
41
43
|
"@types/react": "^19.2.17",
|
|
42
|
-
"@vitejs/plugin-react": "^
|
|
44
|
+
"@vitejs/plugin-react": "^6.0.5",
|
|
43
45
|
"@vitest/browser": "^4.1.10",
|
|
44
46
|
"@vitest/browser-playwright": "^4.1.10",
|
|
45
47
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
@@ -48,21 +50,21 @@
|
|
|
48
50
|
"react": "^19.2.7",
|
|
49
51
|
"typescript": "6.0.3",
|
|
50
52
|
"typescript-eslint": "^8.62.0",
|
|
51
|
-
"vite": "^
|
|
53
|
+
"vite": "^8.2.0",
|
|
52
54
|
"vitest": "^4.1.10",
|
|
53
|
-
"@portabletext/editor": "^7.10.
|
|
54
|
-
"@portabletext/test": "1.0.
|
|
55
|
-
"racejar": "2.0.
|
|
55
|
+
"@portabletext/editor": "^7.10.17",
|
|
56
|
+
"@portabletext/test": "1.0.5",
|
|
57
|
+
"racejar": "2.0.11"
|
|
56
58
|
},
|
|
57
59
|
"peerDependencies": {
|
|
58
60
|
"react": "^19.2",
|
|
59
|
-
"@portabletext/editor": "^7.10.
|
|
61
|
+
"@portabletext/editor": "^7.10.17"
|
|
60
62
|
},
|
|
61
63
|
"engines": {
|
|
62
64
|
"node": ">=20.19 <22 || >=22.12"
|
|
63
65
|
},
|
|
64
66
|
"scripts": {
|
|
65
|
-
"build": "pkg-utils build --strict --check
|
|
67
|
+
"build": "pkg-utils build --strict --check",
|
|
66
68
|
"check:lint": "biome lint .",
|
|
67
69
|
"check:react-compiler": "eslint .",
|
|
68
70
|
"check:types": "tsc",
|