@clevertask/scribe 0.1.22 → 0.1.24

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.
Files changed (35) hide show
  1. package/README.md +34 -2
  2. package/dist/{BarMenu-tPZoiOba.js → BarMenu-DW95OBe1.js} +1 -1
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.js +1 -1
  5. package/dist/components/Menu/BubbleMenu.js +2 -2
  6. package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.js +2 -2
  8. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  9. package/dist/components/Menu/TableBubbleMenu.js +2 -2
  10. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  11. package/dist/components/Scribe/extension/extension-markdown-paste.js +1 -1
  12. package/dist/components/Scribe/extension/external-link-preview/index.js +1 -1
  13. package/dist/components/Scribe/extension/external-link-preview/node-view.js +1 -1
  14. package/dist/components/Scribe/extension/index.js +1 -1
  15. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  16. package/dist/components/Scribe/index.js +4 -4
  17. package/dist/{dist-D31OwZrM.js → dist-_L8dTDsy.js} +1 -1
  18. package/dist/document-node-capabilities.d.ts +47 -0
  19. package/dist/document-node-capabilities.d.ts.map +1 -0
  20. package/dist/document-node-capabilities.js +409 -0
  21. package/dist/{extension-BMUUYPzc.js → extension-B7i7CZ1Y.js} +1 -1
  22. package/dist/{html-to-markdown-D7PT8MhP.js → html-to-markdown-CKpceHDk.js} +1 -1
  23. package/dist/main.js +2 -2
  24. package/dist/{markdown-to-html-ChfR7P_Y.js → markdown-to-html-zj2j0HLf.js} +18 -15
  25. package/dist/{menus-DLKcWlVX.js → menus-BhM4ctz2.js} +2 -2
  26. package/dist/{purify.es-DGv0-Lid.js → purify.es-CpMrJENN.js} +277 -277
  27. package/dist/{schema-extensions-CQTswF0n.js → schema-extensions-ggKYCkRf.js} +397 -372
  28. package/dist/schema-extensions.js +1 -1
  29. package/dist/schema.d.ts +2 -0
  30. package/dist/schema.d.ts.map +1 -1
  31. package/dist/schema.js +4 -3
  32. package/dist/utils/html-to-markdown.js +1 -1
  33. package/dist/utils/index.js +3 -3
  34. package/dist/utils/markdown-to-html.js +1 -1
  35. package/package.json +10 -10
package/README.md CHANGED
@@ -39,7 +39,7 @@ A versatile, block-based rich text editor for diverse applications, built with T
39
39
  ## Installation
40
40
 
41
41
  ```bash
42
- npm install --save-exact @clevertask/scribe @tiptap/pm@3.30.5
42
+ npm install --save-exact @clevertask/scribe @tiptap/pm@3.31.3
43
43
  ```
44
44
 
45
45
  Scribe shares this exact ProseMirror runtime with consumer extensions. Keeping one
@@ -51,7 +51,7 @@ Use the schema subpath when a server or migration tool must parse Scribe content
51
51
  the React editor or Scribe's stylesheet:
52
52
 
53
53
  ```bash
54
- npm install --save-exact @clevertask/scribe @tiptap/core@3.30.5 @tiptap/html@3.30.5 @tiptap/pm@3.30.5
54
+ npm install --save-exact @clevertask/scribe @tiptap/core@3.31.3 @tiptap/html@3.31.3 @tiptap/pm@3.31.3
55
55
  ```
56
56
 
57
57
  ```ts
@@ -75,6 +75,38 @@ schema reusable; it does not make different schema versions interchangeable.
75
75
  Scribe preserves inline code together with other text marks, such as bold and links. This applies
76
76
  only to inline code; code-block text remains unmarked.
77
77
 
78
+ Servers can also inspect Scribe's document-node capabilities through the same headless entry:
79
+
80
+ ```ts
81
+ import {
82
+ createScribeDocumentNodeCapabilityManifest,
83
+ createScribeSchemaExtensions,
84
+ } from "@clevertask/scribe/schema";
85
+ import { getSchema } from "@tiptap/core";
86
+
87
+ const extensions = createScribeSchemaExtensions({ enableUndoRedo: false });
88
+ const capabilities = createScribeDocumentNodeCapabilityManifest(getSchema(extensions));
89
+
90
+ capabilities.paragraph.potentialOperations; // [{ type: "replace_content" }]
91
+ capabilities.callout.potentialOperations; // [{ type: "set_attributes", attributes: ["variant"] }]
92
+ capabilities.taskItem.potentialOperations; // [{ type: "set_attributes", attributes: ["checked"] }]
93
+ capabilities.tableCell.potentialOperations; // []
94
+ ```
95
+
96
+ The manifest intentionally keeps structural list changes application-owned. A consumer can use
97
+ the task-item attribute capability while defining its own bounded policy for adding or moving
98
+ task-list items.
99
+
100
+ These are structural possibilities, not application permissions. An application must still check
101
+ authorization, the current node and its ancestors, protected descendants, revision visibility,
102
+ parser support, and size limits before it offers or performs a write.
103
+
104
+ If an application appends a consumer-owned node to the Scribe schema, it must also pass an exact
105
+ capability declaration to `createScribeDocumentNodeCapabilityManifest`. Use
106
+ `defineScribeDocumentNodeCapability` to type that declaration. Manifest creation fails when a node
107
+ is missing, duplicated, or no longer matches the schema. A custom node can declare no potential
108
+ operations and remain explicitly read-only.
109
+
78
110
  ## Usage
79
111
 
80
112
  ### Basic usage
@@ -1,4 +1,4 @@
1
- import { s as e } from "./dist-D31OwZrM.js";
1
+ import { s as e } from "./dist-_L8dTDsy.js";
2
2
  import { getPopupMountTarget as t } from "./components/Scribe/extension/getPopupMountTarget.js";
3
3
  import n from "./components/Menu/LinkEditor.js";
4
4
  import { hideLinkBubbleMenu as r } from "./components/Menu/linkBubbleMenuPlugin.js";