@lofcz/platejs-utils 52.3.4 → 53.0.0

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 CHANGED
@@ -25,6 +25,9 @@ declare const NODES: {
25
25
  readonly equation: "equation";
26
26
  readonly excalidraw: "excalidraw";
27
27
  readonly file: "file";
28
+ readonly footnoteDefinition: "footnoteDefinition";
29
+ readonly footnoteInput: "footnoteInput";
30
+ readonly footnoteReference: "footnoteReference";
28
31
  readonly h1: "h1";
29
32
  readonly h2: "h2";
30
33
  readonly h3: "h3";
@@ -146,6 +149,9 @@ declare const KEYS: {
146
149
  readonly equation: "equation";
147
150
  readonly excalidraw: "excalidraw";
148
151
  readonly file: "file";
152
+ readonly footnoteDefinition: "footnoteDefinition";
153
+ readonly footnoteInput: "footnoteInput";
154
+ readonly footnoteReference: "footnoteReference";
149
155
  readonly h1: "h1";
150
156
  readonly h2: "h2";
151
157
  readonly h3: "h3";
@@ -218,6 +224,7 @@ interface TColumnGroupElement extends TElement {
218
224
  }
219
225
  interface TDateElement extends TElement {
220
226
  date?: string;
227
+ rawDate?: string;
221
228
  }
222
229
  interface TEquationElement extends TElement {
223
230
  texExpression: string;
@@ -292,6 +299,8 @@ type TMediaProps = {
292
299
  isUpload?: boolean;
293
300
  name?: string;
294
301
  placeholderId?: string;
302
+ provider?: string;
303
+ sourceUrl?: string;
295
304
  };
296
305
  type TMediaElement = TElement & TMediaProps;
297
306
  type TCaptionProps = {
@@ -524,5 +533,4 @@ declare const TrailingBlockPlugin: _platejs_core0.SlatePlugin<PluginConfig<"trai
524
533
  */
525
534
  declare const withTrailingBlock: OverrideEditor<TrailingBlockConfig>;
526
535
  //#endregion
527
- export { EmptyText, ExitBreakPlugin, KEYS, NODES, NodeKey, NormalizeTypesConfig, NormalizeTypesPlugin, PlainText, PlateKey, STYLE_KEYS, SingleBlockPlugin, SingleLinePlugin, StyleKey, TAudioElement, TBasicMarks, TCalloutElement, TCaptionElement, TCaptionProps, TCodeBlockElement, TCodeSyntaxLeaf, TColumnElement, TColumnGroupElement, TComboboxInputElement, TCommentText, TDateElement, TEquationElement, TFileElement, TFontMarks, TIdElement, TIdProps, TImageElement, TIndentElement, TIndentProps, TInlineSuggestionData, TInsertSuggestionData, TLineHeightProps, TLinkElement, TListElement, TListProps, TMediaElement, TMediaEmbedElement, TMediaProps, TMentionElement, TNodeMap, TPlaceholderElement, TRemoveSuggestionData, TResizableElement, TResizableProps, TSuggestionData, TSuggestionElement, TSuggestionProps, TSuggestionText, TTableCellBorder, TTableCellElement, TTableElement, TTableRowElement, TTagElement, TTagProps, TTextAlignProps, TUpdateSuggestionData, TVideoElement, TrailingBlockConfig, TrailingBlockPlugin, withNormalizeTypes, withTrailingBlock };
528
- //# sourceMappingURL=index.d.ts.map
536
+ export { EmptyText, ExitBreakPlugin, KEYS, NODES, NodeKey, NormalizeTypesConfig, NormalizeTypesPlugin, PlainText, PlateKey, STYLE_KEYS, SingleBlockPlugin, SingleLinePlugin, StyleKey, TAudioElement, TBasicMarks, TCalloutElement, TCaptionElement, TCaptionProps, TCodeBlockElement, TCodeSyntaxLeaf, TColumnElement, TColumnGroupElement, TComboboxInputElement, TCommentText, TDateElement, TEquationElement, TFileElement, TFontMarks, TIdElement, TIdProps, TImageElement, TIndentElement, TIndentProps, TInlineSuggestionData, TInsertSuggestionData, TLineHeightProps, TLinkElement, TListElement, TListProps, TMediaElement, TMediaEmbedElement, TMediaProps, TMentionElement, TNodeMap, TPlaceholderElement, TRemoveSuggestionData, TResizableElement, TResizableProps, TSuggestionData, TSuggestionElement, TSuggestionProps, TSuggestionText, TTableCellBorder, TTableCellElement, TTableElement, TTableRowElement, TTagElement, TTagProps, TTextAlignProps, TUpdateSuggestionData, TVideoElement, TrailingBlockConfig, TrailingBlockPlugin, withNormalizeTypes, withTrailingBlock };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as NODES, r as STYLE_KEYS, t as KEYS } from "./plate-keys-C2YNmTqZ.js";
1
+ import { n as NODES, r as STYLE_KEYS, t as KEYS } from "./plate-keys-CN1p7z_o.js";
2
2
  import { createSlatePlugin, createTSlatePlugin } from "@platejs/core";
3
3
  import { ElementApi, NodeApi, PathApi, TextApi, queryNode } from "@platejs/slate";
4
4
 
@@ -139,5 +139,4 @@ const TrailingBlockPlugin = createTSlatePlugin({
139
139
  }).overrideEditor(withTrailingBlock).extend(({ editor }) => ({ options: { type: editor.getType(KEYS.p) } }));
140
140
 
141
141
  //#endregion
142
- export { ExitBreakPlugin, KEYS, NODES, NormalizeTypesPlugin, STYLE_KEYS, SingleBlockPlugin, SingleLinePlugin, TrailingBlockPlugin, withNormalizeTypes, withTrailingBlock };
143
- //# sourceMappingURL=index.js.map
142
+ export { ExitBreakPlugin, KEYS, NODES, NormalizeTypesPlugin, STYLE_KEYS, SingleBlockPlugin, SingleLinePlugin, TrailingBlockPlugin, withNormalizeTypes, withTrailingBlock };
@@ -20,6 +20,9 @@ const NODES = {
20
20
  equation: "equation",
21
21
  excalidraw: "excalidraw",
22
22
  file: "file",
23
+ footnoteDefinition: "footnoteDefinition",
24
+ footnoteInput: "footnoteInput",
25
+ footnoteReference: "footnoteReference",
23
26
  h1: "h1",
24
27
  h2: "h2",
25
28
  h3: "h3",
@@ -123,5 +126,4 @@ const KEYS = {
123
126
  };
124
127
 
125
128
  //#endregion
126
- export { NODES as n, STYLE_KEYS as r, KEYS as t };
127
- //# sourceMappingURL=plate-keys-C2YNmTqZ.js.map
129
+ export { NODES as n, STYLE_KEYS as r, KEYS as t };
@@ -103,5 +103,4 @@ declare const BlockPlaceholderPlugin: _platejs_core_react0.PlatePlugin<PluginCon
103
103
  placeholder: (node: TElement) => string | undefined;
104
104
  }>>;
105
105
  //#endregion
106
- export { BlockPlaceholderConfig, BlockPlaceholderPlugin, useEditorString, useFormInputProps, useMarkToolbarButton, useMarkToolbarButtonState, useRemoveNodeButton, useSelectionAcrossBlocks, useSelectionCollapsed, useSelectionExpanded, useSelectionFragment, useSelectionFragmentProp, useSelectionWithinBlock };
107
- //# sourceMappingURL=index.d.ts.map
106
+ export { BlockPlaceholderConfig, BlockPlaceholderPlugin, useEditorString, useFormInputProps, useMarkToolbarButton, useMarkToolbarButtonState, useRemoveNodeButton, useSelectionAcrossBlocks, useSelectionCollapsed, useSelectionExpanded, useSelectionFragment, useSelectionFragmentProp, useSelectionWithinBlock };
@@ -1,4 +1,4 @@
1
- import { t as KEYS } from "../plate-keys-C2YNmTqZ.js";
1
+ import { t as KEYS } from "../plate-keys-CN1p7z_o.js";
2
2
  import { getContainerTypes } from "@platejs/core";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { createTPlatePlugin, useEditorComposing, useEditorReadOnly, useEditorRef, useEditorSelector, useFocused, usePluginOption } from "@platejs/core/react";
@@ -296,5 +296,4 @@ const BlockPlaceholderPlugin = createTPlatePlugin({
296
296
  } });
297
297
 
298
298
  //#endregion
299
- export { BlockPlaceholderPlugin, useEditorString, useFormInputProps, useMarkToolbarButton, useMarkToolbarButtonState, useRemoveNodeButton, useSelectionAcrossBlocks, useSelectionCollapsed, useSelectionExpanded, useSelectionFragment, useSelectionFragmentProp, useSelectionWithinBlock };
300
- //# sourceMappingURL=index.js.map
299
+ export { BlockPlaceholderPlugin, useEditorString, useFormInputProps, useMarkToolbarButton, useMarkToolbarButtonState, useRemoveNodeButton, useSelectionAcrossBlocks, useSelectionCollapsed, useSelectionExpanded, useSelectionFragment, useSelectionFragmentProp, useSelectionWithinBlock };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lofcz/platejs-utils",
3
- "version": "52.3.4",
3
+ "version": "53.0.0",
4
4
  "description": "Plate utils",
5
5
  "keywords": [
6
6
  "plate",
@@ -32,10 +32,10 @@
32
32
  "clsx": "^2.1.1",
33
33
  "lodash": "^4.17.21",
34
34
  "react-compiler-runtime": "^1.0.0",
35
- "@platejs/core": "npm:@lofcz/platejs-core@52.3.4",
36
- "@platejs/slate": "npm:@lofcz/platejs-slate@52.3.4",
37
- "@udecode/utils": "npm:@lofcz/udecode-utils@52.3.4",
38
- "@udecode/react-utils": "npm:@lofcz/udecode-react-utils@52.3.4"
35
+ "@platejs/core": "npm:@lofcz/platejs-core@53.0.0",
36
+ "@platejs/slate": "npm:@lofcz/platejs-slate@53.0.0",
37
+ "@udecode/react-utils": "npm:@lofcz/udecode-react-utils@52.3.4",
38
+ "@udecode/utils": "npm:@lofcz/udecode-utils@52.3.4"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=18.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/lib/plate-keys.ts","../src/lib/plate-types.ts","../src/lib/plugins/ExitBreakPlugin.ts","../src/lib/plugins/normalize-types/NormalizeTypesPlugin.ts","../src/lib/plugins/normalize-types/withNormalizeTypes.ts","../src/lib/plugins/single-block/SingleBlockPlugin.ts","../src/lib/plugins/single-block/SingleLinePlugin.ts","../src/lib/plugins/trailing-block/TrailingBlockPlugin.ts","../src/lib/plugins/trailing-block/withTrailingBlock.ts"],"sourcesContent":[],"mappings":";;;;;;cAAa;;;;;;EAAA,SA2DH,IAAA,EAAA,MAAA;EAEG,SAAA,OAWH,EAAA,SAAA;EAEG,SA0CH,IAAA,EAAA,MAAA;EAEE,SAAA,SAAO,EAAA,YAA+B;EACtC,SAAA,WAAQ,EAAA,cAAoC;EAC5C,SAAA,QAAQ,EAAA,WAA8B;;;;ECjHjC,SAAA,OAAA,EAAgB,SAAA;EAarB,SAAA,IAAS,EAAA,MAAA;EAET,SAAA,UAAW,EAAA,aAAG;EAET,SAAA,QAAA,EAAA,UAAkB;EAIlB,SAAA,UAAgB,EAAA,YAAQ;EAIxB,SAAA,IAAA,EAAA,MAAe;EAMf,SAAA,EAAA,EAAA,IAAA;EAOA,SAAA,EAAA,EAAA,IAAa;EAIb,SAAA,EAAA,EAAA,IAAA;EAIA,SAAA,EAAA,EAAA,IAAc;EAKd,SAAA,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rGvB,YPqGuB,CAAA,eAAA,EAAA;EAC3C,IAAA,EAAA,MAAQ;AACpB,CAAA,GAAY;;;;ECjHK,IAAA,CAAA,EAAA,MAAA;AAajB,CAAA,mBAAqB,EAAA,CAAA,CAAA,EAAA,CAAuB,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;ADpB/B,cQUA,iBRiDH,EQjDsB,cRiDtB,CQjDqC,mBRiDrC,CAAA"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["createSlatePlugin","InsertExitBreakOptions","KEYS","ExitBreakPlugin","key","exitBreak","editOnly","extendTransforms","editor","insert","options","Omit","tf","insertExitBreak","insertBefore","reverse","OverrideEditor","ElementApi","NodeApi","TElement","NormalizeTypesConfig","withNormalizeTypes","editor","getOptions","tf","normalizeNode","transforms","currentNode","currentPath","rules","onError","length","endCurrentNormalizationPass","some","path","strictType","type","node","get","isElement","children","props","api","create","block","setNodes","at","insertNodes","error","createTSlatePlugin","PluginConfig","Path","KEYS","withNormalizeTypes","NormalizeTypesConfig","rules","Rule","onError","err","path","strictType","type","NormalizeTypesPlugin","key","normalizeTypes","options","overrideEditor","createSlatePlugin","KEYS","SingleBlockPlugin","key","singleBlock","override","enabled","trailingBlock","overrideEditor","editor","tf","normalizeNode","transforms","insertBreak","insertSoftBreak","entry","_node","path","length","children","withoutNormalizing","insertText","at","api","start","mergeNodes","match","_","createSlatePlugin","TextApi","KEYS","SingleLinePlugin","key","singleLine","override","enabled","trailingBlock","overrideEditor","editor","tf","normalizeNode","transforms","insertBreak","insertSoftBreak","entry","node","path","isText","filteredText","text","replace","insertText","at","length","children","withoutNormalizing","mergeNodes","match","_","OverrideEditor","PathApi","queryNode","TrailingBlockConfig","withTrailingBlock","editor","getOptions","tf","normalizeNode","transforms","currentNode","currentPath","level","type","query","length","lastChild","api","last","lastChildNode","at","next","insertNodes","create","block","createTSlatePlugin","PluginConfig","QueryNodeOptions","KEYS","withTrailingBlock","TrailingBlockConfig","level","type","TrailingBlockPlugin","key","trailingBlock","options","overrideEditor","extend","editor","getType","p"],"sources":["../src/lib/plugins/ExitBreakPlugin.ts","../src/lib/plugins/normalize-types/withNormalizeTypes.ts","../src/lib/plugins/normalize-types/NormalizeTypesPlugin.ts","../src/lib/plugins/single-block/SingleBlockPlugin.ts","../src/lib/plugins/single-block/SingleLinePlugin.ts","../src/lib/plugins/trailing-block/withTrailingBlock.ts","../src/lib/plugins/trailing-block/TrailingBlockPlugin.ts"],"sourcesContent":["import { createSlatePlugin, type InsertExitBreakOptions } from '@platejs/core';\n\nimport { KEYS } from '../plate-keys';\n\n/**\n * Insert soft break following configurable rules. Each rule specifies a hotkey\n * and query options.\n */\nexport const ExitBreakPlugin = createSlatePlugin({\n key: KEYS.exitBreak,\n editOnly: true,\n}).extendTransforms(({ editor }) => ({\n insert: (options: Omit<InsertExitBreakOptions, 'reverse'>) =>\n editor.tf.insertExitBreak(options),\n insertBefore: (options: Omit<InsertExitBreakOptions, 'reverse'>) =>\n editor.tf.insertExitBreak({ ...options, reverse: true }),\n}));\n","import type { OverrideEditor } from '@platejs/core';\n\nimport { ElementApi, NodeApi, type TElement } from '@platejs/slate';\n\nimport type { NormalizeTypesConfig } from './NormalizeTypesPlugin';\n\nexport const withNormalizeTypes: OverrideEditor<NormalizeTypesConfig> = ({\n editor,\n getOptions,\n tf: { normalizeNode },\n}) => ({\n transforms: {\n normalizeNode([currentNode, currentPath]) {\n const { rules, onError } = getOptions();\n\n if (currentPath.length === 0) {\n const endCurrentNormalizationPass = rules!.some(\n ({ path, strictType, type }) => {\n const node = NodeApi.get<TElement>(editor, path);\n\n if (node) {\n if (\n strictType &&\n ElementApi.isElement(node) &&\n node.type !== strictType\n ) {\n const { children, ...props } = editor.api.create.block({\n type: strictType,\n });\n editor.tf.setNodes(props, {\n at: path,\n });\n\n return true;\n }\n } else {\n try {\n editor.tf.insertNodes(\n editor.api.create.block({ type: strictType ?? type! }),\n { at: path }\n );\n\n return true;\n } catch (error) {\n onError?.(error);\n }\n }\n\n return false;\n }\n );\n\n if (endCurrentNormalizationPass) {\n return;\n }\n }\n\n return normalizeNode([currentNode, currentPath]);\n },\n },\n});\n","import { createTSlatePlugin, type PluginConfig } from '@platejs/core';\nimport type { Path } from '@platejs/slate';\n\nimport { KEYS } from '../../plate-keys';\nimport { withNormalizeTypes } from './withNormalizeTypes';\n\nexport type NormalizeTypesConfig = PluginConfig<\n 'normalizeTypes',\n {\n /**\n * Set of rules for the types. For each rule, provide a `path` and either\n * `strictType` or `type`. If there is no node existing at `path`: insert a\n * node with `strictType`. If there is a node existing at `path` but its\n * type is not `strictType` or `type`: set the node type to `strictType` or\n * `type`.\n */\n rules?: Rule[];\n onError?: (err: any) => void;\n }\n>;\n\ntype Rule = {\n /** Path where the rule applies */\n path: Path;\n /** Force the type of the node at the given path */\n strictType?: string;\n /** Type of the inserted node at the given path if `strictType` is not provided */\n type?: string;\n};\n\n/** @see {@link withNormalizeTypes} */\nexport const NormalizeTypesPlugin = createTSlatePlugin<NormalizeTypesConfig>({\n key: KEYS.normalizeTypes,\n options: {\n rules: [],\n },\n}).overrideEditor(withNormalizeTypes);\n","import { createSlatePlugin } from '@platejs/core';\n\nimport { KEYS } from '../../plate-keys';\n\n/** Forces editor to only have one block. */\nexport const SingleBlockPlugin = createSlatePlugin({\n key: KEYS.singleBlock,\n override: {\n enabled: {\n [KEYS.trailingBlock]: false,\n },\n },\n}).overrideEditor(({ editor, tf: { normalizeNode } }) => ({\n transforms: {\n insertBreak() {\n editor.tf.insertSoftBreak();\n },\n\n normalizeNode(entry) {\n const [_node, path] = entry;\n\n if (path.length === 0 && editor.children.length > 1) {\n editor.tf.withoutNormalizing(() => {\n // Merge all subsequent blocks into the first block\n while (editor.children.length > 1) {\n editor.tf.insertText('\\n', { at: editor.api.start([1]) });\n editor.tf.mergeNodes({\n at: [1],\n match: (_, path) => path.length === 1,\n });\n }\n });\n\n return;\n }\n\n normalizeNode(entry);\n },\n },\n}));\n","import { createSlatePlugin } from '@platejs/core';\n\nimport { TextApi } from '@platejs/slate';\nimport { KEYS } from '../../plate-keys';\n\n/** Forces editor to only have one line. */\nexport const SingleLinePlugin = createSlatePlugin({\n key: KEYS.singleLine,\n override: {\n enabled: {\n [KEYS.trailingBlock]: false,\n },\n },\n}).overrideEditor(({ editor, tf: { normalizeNode } }) => ({\n transforms: {\n insertBreak() {\n return;\n },\n\n insertSoftBreak() {\n return;\n },\n\n normalizeNode(entry) {\n const [node, path] = entry;\n\n // Filter out line break characters from text nodes\n if (TextApi.isText(node)) {\n const filteredText = node.text.replace(/[\\r\\n\\u2028\\u2029]/g, '');\n if (filteredText !== node.text) {\n editor.tf.insertText(filteredText, { at: path });\n return;\n }\n }\n\n if (path.length === 0 && editor.children.length > 1) {\n editor.tf.withoutNormalizing(() => {\n // Merge all subsequent blocks into the first block\n while (editor.children.length > 1) {\n editor.tf.mergeNodes({\n at: [1],\n match: (_, path) => path.length === 1,\n });\n }\n });\n\n return;\n }\n\n normalizeNode(entry);\n },\n },\n}));\n","import type { OverrideEditor } from '@platejs/core';\n\nimport { PathApi, queryNode } from '@platejs/slate';\n\nimport type { TrailingBlockConfig } from './TrailingBlockPlugin';\n\n/**\n * Add a trailing block when the last node type is not `type` and when the\n * editor has .\n */\nexport const withTrailingBlock: OverrideEditor<TrailingBlockConfig> = ({\n editor,\n getOptions,\n tf: { normalizeNode },\n}) => ({\n transforms: {\n normalizeNode([currentNode, currentPath]) {\n const { level, type, ...query } = getOptions();\n\n if (currentPath.length === 0) {\n const lastChild = editor.api.last([], { level });\n const lastChildNode = lastChild?.[0];\n\n if (\n !lastChildNode ||\n (lastChildNode.type !== type && queryNode(lastChild, query))\n ) {\n const at = lastChild ? PathApi.next(lastChild[1]) : [0];\n\n editor.tf.insertNodes(editor.api.create.block({ type }, at), { at });\n\n return;\n }\n }\n\n return normalizeNode([currentNode, currentPath]);\n },\n },\n});\n","import { createTSlatePlugin, type PluginConfig } from '@platejs/core';\nimport type { QueryNodeOptions } from '@platejs/slate';\n\nimport { KEYS } from '../../plate-keys';\nimport { withTrailingBlock } from './withTrailingBlock';\n\nexport type TrailingBlockConfig = PluginConfig<\n 'trailingBlock',\n {\n /** Level where the trailing node should be, the first level being 0. */\n level?: number;\n /** Type of the trailing block */\n type?: string;\n } & QueryNodeOptions\n>;\n\n/** @see {@link withTrailingBlock} */\nexport const TrailingBlockPlugin = createTSlatePlugin<TrailingBlockConfig>({\n key: KEYS.trailingBlock,\n options: {\n level: 0,\n },\n})\n .overrideEditor(withTrailingBlock)\n .extend(({ editor }) => ({\n options: {\n type: editor.getType(KEYS.p),\n },\n }));\n"],"mappings":";;;;;;;;;AAQA,MAAaG,kBAAkBH,kBAAkB;CAC/CI,KAAKF,KAAKG;CACVC,UAAU;CACX,CAAC,CAACC,kBAAkB,EAAEC,cAAc;CACnCC,SAASC,YACPF,OAAOI,GAAGC,gBAAgBH,QAAQ;CACpCI,eAAeJ,YACbF,OAAOI,GAAGC,gBAAgB;EAAE,GAAGH;EAASK,SAAS;EAAM,CAAA;CAC1D,EAAE;;;;ACVH,MAAaM,sBAA4D,EACvEC,QACAC,YACAC,IAAI,EAAEC,uBACD,EACLC,YAAY,EACVD,cAAc,CAACE,aAAaC,cAAc;CACxC,MAAM,EAAEC,OAAOC,YAAYP,YAAY;AAEvC,KAAIK,YAAYG,WAAW,GAqCzB;MApCoCF,MAAOI,MACxC,EAAEC,MAAMC,YAAYC,WAAW;GAC9B,MAAMC,OAAOnB,QAAQoB,IAAchB,QAAQY,KAAK;AAEhD,OAAIG,MACF;QACEF,cACAlB,WAAWsB,UAAUF,KAAK,IAC1BA,KAAKD,SAASD,YACd;KACA,MAAM,EAAEK,UAAU,GAAGC,UAAUnB,OAAOoB,IAAIC,OAAOC,MAAM,EACrDR,MAAMD,YACP,CAAC;AACFb,YAAOE,GAAGqB,SAASJ,OAAO,EACxBK,IAAIZ,MACL,CAAC;AAEF,YAAO;;SAGT,KAAI;AACFZ,WAAOE,GAAG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sBR,mBAAwC;CACzES,KAAKN,KAAKO;CACVC,SAAS,EACPL,OAAO,GACT;CACD,CAAC,CACCM,eAAeR,kBAAkB,CACjCS,QAAQ,EAAEC,cAAc,EACvBH,SAAS,EACPJ,MAAMO,OAAOC,QAAQZ,KAAKa,EAAC,EAC7B,EACD,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plate-keys-C2YNmTqZ.js","names":["NODES","a","ai","aiChat","audio","blockquote","bold","callout","code","codeBlock","codeDrawing","codeLine","codeSyntax","column","columnGroup","comment","date","emojiInput","equation","excalidraw","file","h1","h2","h3","h4","h5","h6","highlight","hr","img","inlineEquation","italic","kbd","li","lic","link","listTodoClassic","mediaEmbed","mention","mentionInput","olClassic","p","searchHighlight","slashInput","strikethrough","sub","suggestion","sup","table","tag","taskList","td","th","toc","toggle","tr","ulClassic","underline","video","const","STYLE_KEYS","backgroundColor","color","fontFamily","fontSize","fontWeight","indent","lineHeight","listType","textAlign","textIndent","KEYS","autoformat","blockMenu","blockPlaceholder","blockSelection","caption","copilot","csv","cursorOverlay","delete","dnd","docx","emoji","exitBreak","heading","html","juice","list","listChecked","listClassic","listRestart","listRestartPolite","listStart","listTodo","markdown","nodeId","normalizeTypes","ol","placeholder","playwright","removeEmptyNodes","resetNode","singleBlock","singleLine","slashCommand","softBreak","tabbable","trailingBlock","ul","yjs","NodeKey","StyleKey","PlateKey"],"sources":["../src/lib/plate-keys.ts"],"sourcesContent":["export const NODES = {\n a: 'a',\n ai: 'ai',\n aiChat: 'aiChat',\n audio: 'audio',\n blockquote: 'blockquote',\n bold: 'bold',\n callout: 'callout',\n code: 'code',\n codeBlock: 'code_block',\n codeDrawing: 'code_drawing',\n codeLine: 'code_line',\n codeSyntax: 'code_syntax',\n column: 'column',\n columnGroup: 'column_group',\n comment: 'comment',\n date: 'date',\n emojiInput: 'emoji_input',\n equation: 'equation',\n excalidraw: 'excalidraw',\n file: 'file',\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n highlight: 'highlight',\n hr: 'hr',\n img: 'img',\n inlineEquation: 'inline_equation',\n italic: 'italic',\n kbd: 'kbd',\n li: 'li',\n lic: 'lic',\n link: 'a',\n listTodoClassic: 'action_item',\n mediaEmbed: 'media_embed',\n mention: 'mention',\n mentionInput: 'mention_input',\n olClassic: 'ol',\n p: 'p',\n searchHighlight: 'search_highlight',\n slashInput: 'slash_input',\n strikethrough: 'strikethrough',\n sub: 'subscript',\n suggestion: 'suggestion',\n sup: 'superscript',\n table: 'table',\n tag: 'tag',\n taskList: 'taskList',\n td: 'td',\n th: 'th',\n toc: 'toc',\n toggle: 'toggle',\n tr: 'tr',\n ulClassic: 'ul',\n underline: 'underline',\n video: 'video',\n} as const;\n\nexport const STYLE_KEYS = {\n backgroundColor: 'backgroundColor',\n color: 'color',\n fontFamily: 'fontFamily',\n fontSize: 'fontSize',\n fontWeight: 'fontWeight',\n indent: 'indent',\n lineHeight: 'lineHeight',\n listType: 'listStyleType',\n textAlign: 'textAlign',\n textIndent: 'textIndent',\n} as const;\n\nexport const KEYS = {\n ...NODES,\n ...STYLE_KEYS,\n autoformat: 'autoformat',\n blockMenu: 'blockMenu',\n blockPlaceholder: 'blockPlaceholder',\n blockSelection: 'blockSelection',\n caption: 'caption',\n copilot: 'copilot',\n csv: 'csv',\n cursorOverlay: 'cursorOverlay',\n delete: 'delete',\n dnd: 'dnd',\n docx: 'docx',\n emoji: 'emoji',\n exitBreak: 'exitBreak',\n heading: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as string[],\n html: 'html',\n juice: 'juice',\n list: 'list',\n listChecked: 'checked',\n listClassic: 'listClassic',\n listRestart: 'listRestart',\n listRestartPolite: 'listRestartPolite',\n listStart: 'listStart',\n listTodo: 'todo',\n markdown: 'markdown',\n nodeId: 'nodeId',\n normalizeTypes: 'normalizeTypes',\n ol: 'decimal',\n placeholder: 'placeholder',\n playwright: 'playwright',\n removeEmptyNodes: 'removeEmptyNodes',\n resetNode: 'resetNode',\n singleBlock: 'singleBlock',\n singleLine: 'singleLine',\n slashCommand: 'slash_command',\n softBreak: 'softBreak',\n tabbable: 'tabbable',\n trailingBlock: 'trailingBlock',\n ul: 'disc',\n yjs: 'yjs',\n} as const;\n\nexport type NodeKey = (typeof NODES)[keyof typeof NODES];\nexport type StyleKey = (typeof STYLE_KEYS)[keyof typeof STYLE_KEYS];\nexport type PlateKey = (typeof KEYS)[keyof typeof KEYS];\n"],"mappings":";AAAA,MAAaA,QAAQ;CACnBC,GAAG;CACHC,IAAI;CACJC,QAAQ;CACRC,OAAO;CACPC,YAAY;CACZC,MAAM;CACNC,SAAS;CACTC,MAAM;CACNC,WAAW;CACXC,aAAa;CACbC,UAAU;CACVC,YAAY;CACZC,QAAQ;CACRC,aAAa;CACbC,SAAS;CACTC,MAAM;CACNC,YAAY;CACZC,UAAU;CACVC,YAAY;CACZC,MAAM;CACNC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,WAAW;CACXC,IAAI;CACJC,KAAK;CACLC,gBAAgB;CAChBC,QAAQ;CACRC,KAAK;CACLC,IAAI;CACJC,KAAK;CACLC,MAAM;CACNC,iBAAiB;CACjBC,YAAY;CACZC,SAAS;CACTC,cAAc;CACdC,WAAW;CACXC,GAAG;CACHC,iBAAiB;CACjBC,YAAY;CACZC,eAAe;CACfC,KAAK;CACLC,YAAY;CACZC,KAAK;CACLC,OAAO;CACPC,KAAK;CACLC,UAAU;CACVC,IAAI;CACJC,IAAI;CACJC,KAAK;CACLC,QAAQ;CACRC,IAAI;CACJC,WAAW;CACXC,WAAW;CACXC,OAAO;CACR;AAED,MAAaE,aAAa;CACxBC,iBAAiB;CACjBC,OAAO;CACPC,YAAY;CACZC,UAAU;CACVC,YAAY;CACZC,QAAQ;CACRC,YAAY;CACZC,UAAU;CACVC,WAAW;CACXC,YAAY;CACb;AAED,MAAaC,OAAO;CAClB,GAAGvE;CACH,GAAG4D;CACHY,YAAY;CACZC,WAAW;CACXC,kBAAkB;CAClBC,gBAAgB;CAChBC,SAAS;CACTC,SAAS;CACTC,KAAK;CACLC,eAAe;CACfC,QAAQ;CACRC,KAAK;CACLC,MAAM;CACNC,OAAO;CACPC,WAAW;CACXC,SAAS;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAK;CAC7CC,MAAM;CACNC,OAAO;CACPC,MAAM;CACNC,aAAa;CACbC,aAAa;CACbC,aAAa;CACbC,mBAAmB;CACnBC,WAAW;CACXC,UAAU;CACVC,UAAU;CACVC,QAAQ;CACRC,gBAAgB;CAChBC,IAAI;CACJC,aAAa;CACbC,YAAY;CACZC,kBAAkB;CAClBC,WAAW;CACXC,aAAa;CACbC,YAAY;CACZC,cAAc;CACdC,WAAW;CACXC,UAAU;CACVC,eAAe;CACfC,IAAI;CACJC,KAAK;CACN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/react/hooks/useEditorString.ts","../../src/react/hooks/useFormInputProps.ts","../../src/react/hooks/useMarkToolbarButton.ts","../../src/react/hooks/useRemoveNodeButton.ts","../../src/react/hooks/useSelection.ts","../../src/react/hooks/useSelectionFragment.ts","../../src/react/plugins/BlockPlaceholderPlugin.tsx"],"sourcesContent":[],"mappings":";;;;;;;cAEa;;;KCFR,UAAA;;;;;;;ADEL;;;;;ACcA;;;AAmCoB,cAnCP,iBAmCO,EAAA,CAAA,OAAA,CAAA,EAnCwB,UAmCxB,EAAA,GAAA;EAAa,KAAA,EAAA;;;;ECjDpB,KAAA,EAAA;IAmBA,gBAAA,EAAA,CAiBZ,CAAA,CAAA,EDaa,KAAA,CAAM,aCbnB,CDaiC,cCbjC,CAAA,EAAA,GAAA,IAAA,CAAA,GAAA,SAAA;EAhB0B,CAAA;CAAlB;;;cApBI;;;;;;;;;;AFAb,CAAA;cEmBa,8BACJ,kBAAkB;;;IDtBtB,OAAA,EAAU,GAAA,GAAA,IAAA;IAgBF,WAAA,EAAA,CAAA,CAAA,ECiBU,KAAA,CAAM,UDuB5B,CCvBuC,iBDuBvC,CAAA,EAAA,GAAA,IAAA;EAxC2C,CAAA;CAmCV;;;cEhDrB;;;WAA+C;;;;qBAUrC,KAAA,CAAM,WAAW;EHX3B,CAAA;;;;iBIAG,qBAAA,CAAA;iBAIA,oBAAA,CAAA;iBAIA,uBAAA,CAAA;iBAIA,wBAAA,CAAA;;;cCVH,4BAAoB,eAAA,CAAA,gBAO9B,eAAA,CAP8B,KAAA;cASpB,qCACF,KAAK;;;KCCJ,sBAAA,GAAyB;;UAGhB;;ENhBR,CAAA,GAAA,IAAA;gBMiBK;mBAEH,mBAAmB;UACpB;ILtBT,IAAA,EKuBS,ILvBC;EAgBF,CAAA,EAAA,GAAA,OAAA;EAA+B,SAAA,CAAA,EAAA,MAAA;CAmCV,CAAA;AAAd,cKrBP,sBLqBO,EKrBe,oBAAA,CAAA,WLqBf,CKrBe,YLqBf,CAAA,kBAAA,EAAA;EAAa,OAAA,EAAA;UKjCZ;;;EJhBR,YAAA,EIiBK,MJjBL,CAAA,MAAA,EAiBZ,MAAA,CAAA;EAEY,KAAA,EAAA,CAAA,OAAA,EIAE,kBJiBd,CIjBiC,sBJiBjC,CAAA,GAAA;IAhB0B,IAAA,EIAb,QJAa;IAAlB,IAAA,EICK,IJDL;EAW+B,CAAA,EAAA,GAAA,OAAA;EAAjB,SAAM,CAAA,EAAA,MAAA;CAAU,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA;sBIgFb"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["useEditorSelector","useEditorString","$","_c","t0","Symbol","for","_temp","editor","api","string","InputProps","preventDefaultOnEnterKeydown","useFormInputProps","options","props","handleEnterKeydownCapture","e","React","KeyboardEvent","HTMLDivElement","key","keyCode","preventDefault","onKeyDownCapture","undefined","useEditorRef","useEditorSelector","useMarkToolbarButtonState","t0","$","_c","clear","nodeType","t1","t2","editor","api","hasMark","pressed","t3","useMarkToolbarButton","state","tf","toggleMark","remove","focus","props","onClick","onMouseDown","_temp","e","preventDefault","useEditorRef","TElement","useRemoveNodeButton","t0","$","_c","element","editor","t1","props","onClick","path","api","findPath","tf","removeNodes","at","onMouseDown","_temp","e","preventDefault","useEditorSelector","useSelectionCollapsed","$","_c","t0","Symbol","for","_temp","editor","api","isExpanded","useSelectionExpanded","_temp2","useSelectionWithinBlock","_temp3","isAt","block","useSelectionAcrossBlocks","_temp4","blocks","getContainerTypes","useEditorSelector","EditorPropOptions","TElement","useSelectionFragment","$","_c","t0","Symbol","for","_temp","useSelectionFragmentProp","t1","undefined","options","t2","editor","fragment","api","selection","unwrap","prop","nodes","t3","PluginConfig","createTPlatePlugin","PlatePluginContext","useEditorComposing","useEditorReadOnly","useEditorSelector","useFocused","usePluginOption","Path","TElement","React","KEYS","BlockPlaceholderConfig","_target","node","placeholder","placeholders","Record","query","context","path","className","BlockPlaceholderPlugin","key","blockPlaceholder","editOnly","options","p","length","useHooks","ctx","editor","getOptions","setOption","focused","readOnly","composing","entry","selection","api","isExpanded","block","useEffect","element","Object","keys","find","getType","type","isEmpty","extendSelectors","getOption","target","extend","inject","isBlock","nodeProps","transformProps","props","plugin"],"sources":["../../src/react/hooks/useEditorString.ts","../../src/react/hooks/useFormInputProps.ts","../../src/react/hooks/useMarkToolbarButton.ts","../../src/react/hooks/useRemoveNodeButton.ts","../../src/react/hooks/useSelection.ts","../../src/react/hooks/useSelectionFragment.ts","../../src/react/plugins/BlockPlaceholderPlugin.tsx"],"sourcesContent":["import { useEditorSelector } from '@platejs/core/react';\n\nexport const useEditorString = () =>\n useEditorSelector((editor) => editor.api.string([]), []);\n","type InputProps = {\n /**\n * Should we activate the onKeyDownCapture handler to preventDefault when the\n * user presses enter?\n */\n preventDefaultOnEnterKeydown?: boolean;\n};\n\n/**\n * Hook to allow the user to spread a set of predefined props to the Div wrapper\n * of an Input element\n *\n * @param param0 An options object which can be expanded to add further\n * functionality\n * @returns A props object which can be spread onto the element\n */\nexport const useFormInputProps = (options?: InputProps) => {\n // Nothing provided to just return an empty object which can still be spread.\n // If we need to add more functionality later we will still be able to do so\n if (!options) return { props: {} };\n\n // Destructure our options so we can use them\n const { preventDefaultOnEnterKeydown } = options;\n\n /**\n * Handle the keydown capture event and prevent the default behaviour when the\n * user presses enter.\n *\n * In the event the user presses enter on a field such as a link, prior to\n * filling in both label and url, the default behaviour is to submit the form.\n * This, ultimately, results in no link being added as you need to fill both\n * fields to pass validation.\n *\n * By calling preventDefault we short circuit the form's submission thus\n * allowing the user to continue filling in the other fields\n *\n * @param e The original event which was provided by the VDOM implement their\n * own behaviour on this event\n */\n const handleEnterKeydownCapture = (\n e: React.KeyboardEvent<HTMLDivElement>\n ) => {\n // Prevent the form from submitting\n if (e.key === 'Enter' || e.keyCode === 13) {\n e.preventDefault();\n }\n };\n\n return {\n props: {\n onKeyDownCapture: preventDefaultOnEnterKeydown\n ? (e: React.KeyboardEvent<HTMLDivElement>) =>\n handleEnterKeydownCapture(e)\n : undefined,\n },\n };\n};\n","import { useEditorRef, useEditorSelector } from '@platejs/core/react';\n\nexport const useMarkToolbarButtonState = ({\n clear,\n nodeType,\n}: {\n nodeType: string;\n clear?: string[] | string;\n}) => {\n const pressed = useEditorSelector(\n (editor) => editor.api.hasMark(nodeType),\n [nodeType]\n );\n\n return {\n clear,\n nodeType,\n pressed,\n };\n};\n\nexport const useMarkToolbarButton = (\n state: ReturnType<typeof useMarkToolbarButtonState>\n) => {\n const editor = useEditorRef();\n\n return {\n props: {\n pressed: state.pressed,\n onClick: () => {\n editor.tf.toggleMark(state.nodeType, { remove: state.clear });\n editor.tf.focus();\n },\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n },\n },\n };\n};\n","import { useEditorRef } from '@platejs/core/react';\nimport type { TElement } from '@platejs/slate';\n\nexport const useRemoveNodeButton = ({ element }: { element: TElement }) => {\n const editor = useEditorRef();\n\n return {\n props: {\n onClick: () => {\n const path = editor.api.findPath(element);\n\n editor.tf.removeNodes({ at: path });\n },\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n },\n },\n };\n};\n","import { useEditorSelector } from '@platejs/core/react';\n\nexport function useSelectionCollapsed() {\n return useEditorSelector((editor) => !editor.api.isExpanded(), []);\n}\n\nexport function useSelectionExpanded() {\n return useEditorSelector((editor) => editor.api.isExpanded(), []);\n}\n\nexport function useSelectionWithinBlock() {\n return useEditorSelector((editor) => editor.api.isAt({ block: true }), []);\n}\n\nexport function useSelectionAcrossBlocks() {\n return useEditorSelector((editor) => editor.api.isAt({ blocks: true }), []);\n}\n","import { getContainerTypes } from '@platejs/core';\nimport { useEditorSelector } from '@platejs/core/react';\nimport type { EditorPropOptions, TElement } from '@platejs/slate';\n\nexport const useSelectionFragment = () =>\n useEditorSelector(\n (editor) =>\n editor.api.fragment(editor.selection, {\n unwrap: getContainerTypes(editor),\n }),\n []\n );\n\nexport const useSelectionFragmentProp = (\n options: Omit<EditorPropOptions, 'nodes'> = {}\n) =>\n useEditorSelector((editor) => {\n const fragment = editor.api.fragment<TElement>(editor.selection, {\n unwrap: getContainerTypes(editor),\n });\n\n return editor.api.prop({ nodes: fragment, ...options });\n }, []);\n","import type { PluginConfig } from '@platejs/core';\nimport {\n createTPlatePlugin,\n type PlatePluginContext,\n useEditorComposing,\n useEditorReadOnly,\n useEditorSelector,\n useFocused,\n usePluginOption,\n} from '@platejs/core/react';\nimport type { Path, TElement } from '@platejs/slate';\nimport React from 'react';\n\nimport { KEYS } from '../../lib';\n\nexport type BlockPlaceholderConfig = PluginConfig<\n 'blockPlaceholder',\n {\n _target: { node: TElement; placeholder: string } | null;\n placeholders: Record<string, string>;\n query: (\n context: PlatePluginContext<BlockPlaceholderConfig> & {\n node: TElement;\n path: Path;\n }\n ) => boolean;\n className?: string;\n }\n>;\n\nexport const BlockPlaceholderPlugin =\n createTPlatePlugin<BlockPlaceholderConfig>({\n key: KEYS.blockPlaceholder,\n editOnly: true,\n options: {\n _target: null,\n placeholders: {\n [KEYS.p]: 'Type something...',\n },\n query: ({ path }) => path.length === 1,\n },\n useHooks: (ctx) => {\n const { editor, getOptions, setOption } = ctx;\n const focused = useFocused();\n\n const readOnly = useEditorReadOnly();\n const composing = useEditorComposing();\n const entry = useEditorSelector(() => {\n if (\n readOnly ||\n composing ||\n !focused ||\n !editor.selection ||\n editor.api.isExpanded()\n )\n return null;\n\n return editor.api.block();\n }, [readOnly, composing, focused]);\n\n React.useEffect(() => {\n if (!entry) {\n setOption('_target', null);\n return;\n }\n\n const { placeholders, query } = getOptions();\n\n const [element, path] = entry;\n\n // const getPlaceholder = (node: TElement) => {\n // if (node?.listStyleType) {\n // switch (node.listStyleType) {\n // case 'disc':\n // return 'List';\n // break;\n // case 'decimal':\n // return 'List';\n // break;\n // case 'todo':\n // return 'To-do';\n // break;\n // }\n // }\n\n // const key = getPluginKey(editor, node.type);\n // if (!key) return;\n\n // return placeholders?.[key];\n // }\n\n const placeholder = Object.keys(placeholders).find(\n (key) => editor.getType(key) === element.type\n );\n\n if (\n query({ ...ctx, node: element, path }) &&\n placeholder &&\n editor.api.isEmpty(element) &&\n !editor.api.isEmpty()\n ) {\n setOption('_target', {\n node: element,\n placeholder: placeholders[placeholder],\n });\n } else {\n setOption('_target', null);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor, entry, setOption, getOptions]);\n },\n })\n .extendSelectors(({ getOption }) => ({\n placeholder: (node: TElement) => {\n const target = getOption('_target');\n\n if (target?.node === node) {\n return target.placeholder;\n }\n },\n }))\n .extend({\n inject: {\n isBlock: true,\n nodeProps: {\n transformProps: (props) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const placeholder = usePluginOption(\n props.plugin,\n 'placeholder',\n props.element!\n );\n\n if (placeholder) {\n return {\n className: props.getOption('className'),\n placeholder,\n };\n }\n },\n },\n },\n });\n"],"mappings":";;;;;;;AAEA,MAAaC,wBAAkB;CAAA,MAAAC,IAAAC,E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