@lyads/visual-editor 0.0.0-stage → 1.0.1

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 (258) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +8 -0
  4. package/README.md +135 -2
  5. package/THIRD_PARTY_NOTICES.md +21259 -0
  6. package/dist/application/block-placement.d.ts +30 -0
  7. package/dist/application/block-session.d.ts +135 -0
  8. package/dist/application/content-service.d.ts +73 -0
  9. package/dist/application/document-commands.d.ts +51 -0
  10. package/dist/application/document-metadata.d.ts +30 -0
  11. package/dist/application/document-presentation.d.ts +35 -0
  12. package/dist/application/email-insertion.d.ts +76 -0
  13. package/dist/application/host.d.ts +36 -0
  14. package/dist/application/image-link.d.ts +36 -0
  15. package/dist/application/section-layout.d.ts +25 -0
  16. package/dist/application/session.d.ts +128 -0
  17. package/dist/assets/browser-worker-D56tNvnb.js +1014 -0
  18. package/dist/assets/browser-worker-D56tNvnb.js.map +1 -0
  19. package/dist/block-controller-RjYGvOcn.js +2468 -0
  20. package/dist/block-controller-RjYGvOcn.js.map +1 -0
  21. package/dist/block-factory-C5oHi4Fm.js +5397 -0
  22. package/dist/block-factory-C5oHi4Fm.js.map +1 -0
  23. package/dist/blocks/block-checks.d.ts +34 -0
  24. package/dist/blocks/block-inspector.d.ts +55 -0
  25. package/dist/blocks/block-output.d.ts +28 -0
  26. package/dist/blocks/block-type.d.ts +124 -0
  27. package/dist/blocks/content-guard.d.ts +52 -0
  28. package/dist/blocks/conversion.d.ts +22 -0
  29. package/dist/blocks/definitions.d.ts +43 -0
  30. package/dist/blocks/device-styles.d.ts +31 -0
  31. package/dist/blocks/email-generator.d.ts +22 -0
  32. package/dist/blocks/email-preview.d.ts +23 -0
  33. package/dist/blocks/email-renderer.d.ts +20 -0
  34. package/dist/blocks/fields.d.ts +34 -0
  35. package/dist/blocks/page-generator.d.ts +16 -0
  36. package/dist/blocks/render-context.d.ts +58 -0
  37. package/dist/blocks/styles.d.ts +54 -0
  38. package/dist/blocks/types/embed.d.ts +40 -0
  39. package/dist/blocks/types/layout.d.ts +41 -0
  40. package/dist/blocks/types/media.d.ts +53 -0
  41. package/dist/blocks/types/structure.d.ts +44 -0
  42. package/dist/blocks/types/text.d.ts +88 -0
  43. package/dist/blocks/values.d.ts +64 -0
  44. package/dist/browser.js +69 -0
  45. package/dist/browser.js.map +1 -0
  46. package/dist/canvas-runtime/action-bar.d.ts +19 -0
  47. package/dist/canvas-runtime/auto-scroll.d.ts +10 -0
  48. package/dist/canvas-runtime/block-drag.d.ts +29 -0
  49. package/dist/canvas-runtime/bridge.d.ts +6 -0
  50. package/dist/canvas-runtime/context.d.ts +53 -0
  51. package/dist/canvas-runtime/document-sync.d.ts +21 -0
  52. package/dist/canvas-runtime/drop-targets.d.ts +34 -0
  53. package/dist/canvas-runtime/embed-markers.d.ts +15 -0
  54. package/dist/canvas-runtime/file-guard.d.ts +12 -0
  55. package/dist/canvas-runtime/image-tools.d.ts +31 -0
  56. package/dist/canvas-runtime/keyboard.d.ts +18 -0
  57. package/dist/canvas-runtime/main.d.ts +1 -0
  58. package/dist/canvas-runtime/messages.d.ts +26 -0
  59. package/dist/canvas-runtime/morph.d.ts +21 -0
  60. package/dist/canvas-runtime/navigation.d.ts +29 -0
  61. package/dist/canvas-runtime/overlay.d.ts +15 -0
  62. package/dist/canvas-runtime/pointer-intents.d.ts +14 -0
  63. package/dist/canvas-runtime/selection-layer.d.ts +16 -0
  64. package/dist/canvas-runtime/shared/shortcuts.d.ts +27 -0
  65. package/dist/canvas-runtime/text-editor.d.ts +55 -0
  66. package/dist/canvas-runtime/text-session.d.ts +39 -0
  67. package/dist/canvas-runtime/variable-marks.d.ts +20 -0
  68. package/dist/canvas-runtime/viewport.d.ts +10 -0
  69. package/dist/codecs/css.d.ts +74 -0
  70. package/dist/codecs/html.d.ts +81 -0
  71. package/dist/compilation/browser-compiler.d.ts +14 -0
  72. package/dist/compilation/browser-worker.d.ts +1 -0
  73. package/dist/compilation/compile-lanes.d.ts +18 -0
  74. package/dist/compilation/generated-mjml.d.ts +25 -0
  75. package/dist/compilation/guard.d.ts +40 -0
  76. package/dist/compilation/node-compiler.d.ts +17 -0
  77. package/dist/compilation/node-worker.d.ts +1 -0
  78. package/dist/composition/block-factory.d.ts +84 -0
  79. package/dist/composition/browser.d.ts +48 -0
  80. package/dist/composition/factory.d.ts +48 -0
  81. package/dist/composition/server.d.ts +43 -0
  82. package/dist/core/any-document.d.ts +16 -0
  83. package/dist/core/block-document.d.ts +215 -0
  84. package/dist/core/budget.d.ts +32 -0
  85. package/dist/core/canvas-contract.d.ts +29 -0
  86. package/dist/core/canvas-layout.d.ts +66 -0
  87. package/dist/core/catalog.d.ts +35 -0
  88. package/dist/core/document-presentation.d.ts +21 -0
  89. package/dist/core/document.d.ts +99 -0
  90. package/dist/core/history.d.ts +26 -0
  91. package/dist/core/html-content-model.d.ts +32 -0
  92. package/dist/core/html-escape.d.ts +2 -0
  93. package/dist/core/rich-text-format.d.ts +14 -0
  94. package/dist/core/rich-text-markup.d.ts +28 -0
  95. package/dist/core/section-layout.d.ts +83 -0
  96. package/dist/generated-mjml-CtzE-f3v.js +1235 -0
  97. package/dist/generated-mjml-CtzE-f3v.js.map +1 -0
  98. package/dist/identity-CJHb6l9N.js +13759 -0
  99. package/dist/identity-CJHb6l9N.js.map +1 -0
  100. package/dist/renderers/canvas-bridge.d.ts +75 -0
  101. package/dist/renderers/canvas-icons.d.ts +1 -0
  102. package/dist/renderers/canvas-runtime.generated.d.ts +3 -0
  103. package/dist/renderers/element-source.d.ts +13 -0
  104. package/dist/renderers/email-renderer.d.ts +14 -0
  105. package/dist/renderers/marked-preview.d.ts +34 -0
  106. package/dist/renderers/markup-tree.d.ts +36 -0
  107. package/dist/renderers/page-renderer.d.ts +15 -0
  108. package/dist/renderers/preview-document.d.ts +39 -0
  109. package/dist/renderers/preview-frame.d.ts +102 -0
  110. package/dist/renderers/section-scaffold.d.ts +16 -0
  111. package/dist/renderers/selection-preview.d.ts +47 -0
  112. package/dist/rich-text/command-executor.d.ts +26 -0
  113. package/dist/rich-text/commands.d.ts +36 -0
  114. package/dist/rich-text/document-builder.d.ts +52 -0
  115. package/dist/rich-text/formatting.d.ts +17 -0
  116. package/dist/rich-text/projection-export.d.ts +17 -0
  117. package/dist/rich-text/projection-rules.d.ts +13 -0
  118. package/dist/rich-text/schema.d.ts +50 -0
  119. package/dist/rich-text/whitespace.d.ts +7 -0
  120. package/dist/security/bounded-parser.d.ts +18 -0
  121. package/dist/security/conditional-comment.d.ts +30 -0
  122. package/dist/security/content-inventory.d.ts +78 -0
  123. package/dist/security/email-sanitizer.d.ts +36 -0
  124. package/dist/security/identity.d.ts +6 -0
  125. package/dist/security/markup-rules.d.ts +31 -0
  126. package/dist/security/policy.d.ts +61 -0
  127. package/dist/security/preview-message.d.ts +317 -0
  128. package/dist/security/rich-text-projection.d.ts +19 -0
  129. package/dist/security/sha256.d.ts +6 -0
  130. package/dist/security/source-markup.d.ts +53 -0
  131. package/dist/security/text-presentation.d.ts +19 -0
  132. package/dist/security/url-policy.d.ts +23 -0
  133. package/dist/server-worker.js +17 -0
  134. package/dist/server-worker.js.map +1 -0
  135. package/dist/server.js +79 -0
  136. package/dist/server.js.map +1 -0
  137. package/dist/templates/blank-email.d.ts +6 -0
  138. package/dist/templates/blocks/catalog.d.ts +31 -0
  139. package/dist/templates/catalog.d.ts +31 -0
  140. package/dist/visual-editor.css +2 -0
  141. package/dist/vue/block-controller.d.ts +106 -0
  142. package/dist/vue/block-workbench.d.ts +70 -0
  143. package/dist/vue/canvas/canvas-theme.d.ts +8 -0
  144. package/dist/vue/canvas/file-drop.d.ts +38 -0
  145. package/dist/vue/canvas/frame-window.d.ts +26 -0
  146. package/dist/vue/canvas/inline-text.d.ts +98 -0
  147. package/dist/vue/canvas/palette-drag.d.ts +55 -0
  148. package/dist/vue/canvas/piece-requests.d.ts +48 -0
  149. package/dist/vue/canvas/strip-reserve.d.ts +14 -0
  150. package/dist/vue/canvas-content-label.d.ts +5 -0
  151. package/dist/vue/components/BlockVisualEditor.vue.d.ts +44 -0
  152. package/dist/vue/components/CanvasSurface.vue.d.ts +11 -0
  153. package/dist/vue/components/CodeEditor.vue.d.ts +22 -0
  154. package/dist/vue/components/EditorBlockMenus.vue.d.ts +3 -0
  155. package/dist/vue/components/EditorBlockPalette.vue.d.ts +3 -0
  156. package/dist/vue/components/EditorDiagnostics.vue.d.ts +3 -0
  157. package/dist/vue/components/EditorDialogs.vue.d.ts +16 -0
  158. package/dist/vue/components/EditorDocumentMetadata.vue.d.ts +3 -0
  159. package/dist/vue/components/EditorDocumentStyles.vue.d.ts +15 -0
  160. package/dist/vue/components/EditorImageSizeControls.vue.d.ts +23 -0
  161. package/dist/vue/components/EditorLayoutControls.vue.d.ts +16 -0
  162. package/dist/vue/components/EditorLeftPanel.vue.d.ts +3 -0
  163. package/dist/vue/components/EditorNoticeIndicator.vue.d.ts +3 -0
  164. package/dist/vue/components/EditorPreview.vue.d.ts +8 -0
  165. package/dist/vue/components/EditorProperties.vue.d.ts +14 -0
  166. package/dist/vue/components/EditorRichTextControls.vue.d.ts +25 -0
  167. package/dist/vue/components/EditorSelectionPath.vue.d.ts +11 -0
  168. package/dist/vue/components/EditorShortcutHelp.vue.d.ts +3 -0
  169. package/dist/vue/components/EditorSourcePane.vue.d.ts +3 -0
  170. package/dist/vue/components/EditorStructureTree.vue.d.ts +3 -0
  171. package/dist/vue/components/EditorTemplateGallery.vue.d.ts +15 -0
  172. package/dist/vue/components/EditorTopBar.vue.d.ts +33 -0
  173. package/dist/vue/components/RichTextEditor.vue.d.ts +47 -0
  174. package/dist/vue/components/SelectionPreviewFrame.vue.d.ts +212 -0
  175. package/dist/vue/components/VisualEditor.vue.d.ts +53 -0
  176. package/dist/vue/components/blocks/BlockCanvas.vue.d.ts +15 -0
  177. package/dist/vue/components/blocks/BlockFieldControl.vue.d.ts +39 -0
  178. package/dist/vue/components/blocks/BlockGlobalStyles.vue.d.ts +3 -0
  179. package/dist/vue/components/blocks/BlockPalette.vue.d.ts +6 -0
  180. package/dist/vue/components/blocks/BlockProperties.vue.d.ts +5 -0
  181. package/dist/vue/components/blocks/BlockReview.vue.d.ts +5 -0
  182. package/dist/vue/components/properties/EditorPropertyAdvanced.vue.d.ts +8 -0
  183. package/dist/vue/components/properties/EditorPropertyContent.vue.d.ts +13 -0
  184. package/dist/vue/components/properties/EditorPropertyStyle.vue.d.ts +8 -0
  185. package/dist/vue/components/ui/EditorAnchoredMenu.vue.d.ts +36 -0
  186. package/dist/vue/components/ui/EditorBadge.vue.d.ts +18 -0
  187. package/dist/vue/components/ui/EditorButton.vue.d.ts +28 -0
  188. package/dist/vue/components/ui/EditorCheckbox.vue.d.ts +13 -0
  189. package/dist/vue/components/ui/EditorColorInput.vue.d.ts +27 -0
  190. package/dist/vue/components/ui/EditorConfirmDialog.vue.d.ts +35 -0
  191. package/dist/vue/components/ui/EditorContextMenu.vue.d.ts +27 -0
  192. package/dist/vue/components/ui/EditorContextPopover.vue.d.ts +33 -0
  193. package/dist/vue/components/ui/EditorEmpty.vue.d.ts +8 -0
  194. package/dist/vue/components/ui/EditorField.vue.d.ts +24 -0
  195. package/dist/vue/components/ui/EditorGroup.vue.d.ts +16 -0
  196. package/dist/vue/components/ui/EditorIcon.vue.d.ts +6 -0
  197. package/dist/vue/components/ui/EditorIconButton.vue.d.ts +19 -0
  198. package/dist/vue/components/ui/EditorInput.vue.d.ts +41 -0
  199. package/dist/vue/components/ui/EditorKeys.vue.d.ts +6 -0
  200. package/dist/vue/components/ui/EditorMeasurement.vue.d.ts +34 -0
  201. package/dist/vue/components/ui/EditorMenu.vue.d.ts +56 -0
  202. package/dist/vue/components/ui/EditorNotice.vue.d.ts +30 -0
  203. package/dist/vue/components/ui/EditorPropertyGroup.vue.d.ts +22 -0
  204. package/dist/vue/components/ui/EditorRecoveryDialog.vue.d.ts +23 -0
  205. package/dist/vue/components/ui/EditorScrollArea.vue.d.ts +13 -0
  206. package/dist/vue/components/ui/EditorSelect.vue.d.ts +25 -0
  207. package/dist/vue/components/ui/EditorSeparator.vue.d.ts +8 -0
  208. package/dist/vue/components/ui/EditorSidePanel.vue.d.ts +26 -0
  209. package/dist/vue/components/ui/EditorSwitch.vue.d.ts +12 -0
  210. package/dist/vue/components/ui/EditorTabs.vue.d.ts +28 -0
  211. package/dist/vue/components/ui/EditorTemplatePreview.vue.d.ts +9 -0
  212. package/dist/vue/components/ui/EditorTextToolbar.vue.d.ts +16 -0
  213. package/dist/vue/components/ui/EditorTree.vue.d.ts +37 -0
  214. package/dist/vue/components/ui/EditorUiProvider.vue.d.ts +13 -0
  215. package/dist/vue/components/ui/EditorVariablePicker.vue.d.ts +20 -0
  216. package/dist/vue/components/ui/color-style-value.d.ts +9 -0
  217. package/dist/vue/components/ui/composition-dismissal.d.ts +1 -0
  218. package/dist/vue/components/ui/editor-dialog-focus.d.ts +6 -0
  219. package/dist/vue/components/ui/numeric-style-value.d.ts +15 -0
  220. package/dist/vue/controller.d.ts +115 -0
  221. package/dist/vue/font-options.d.ts +6 -0
  222. package/dist/vue/icon-data.d.ts +233 -0
  223. package/dist/vue/icons.d.ts +5 -0
  224. package/dist/vue/locale.d.ts +7 -0
  225. package/dist/vue/outline.d.ts +26 -0
  226. package/dist/vue/projection-key.d.ts +7 -0
  227. package/dist/vue/properties/selection-properties.d.ts +40 -0
  228. package/dist/vue/properties/style-fields.d.ts +30 -0
  229. package/dist/vue/public.d.ts +14 -0
  230. package/dist/vue/recovery.d.ts +30 -0
  231. package/dist/vue/responsive-panel.d.ts +1 -0
  232. package/dist/vue/rich-text-commands.d.ts +29 -0
  233. package/dist/vue/services/block-command-definitions.d.ts +14 -0
  234. package/dist/vue/services/block-commands.d.ts +114 -0
  235. package/dist/vue/services/block-menu.d.ts +12 -0
  236. package/dist/vue/services/block-palette.d.ts +21 -0
  237. package/dist/vue/services/block-presentation.d.ts +16 -0
  238. package/dist/vue/services/diagnostic-groups.d.ts +25 -0
  239. package/dist/vue/services/image-requests.d.ts +80 -0
  240. package/dist/vue/services/live-change.d.ts +26 -0
  241. package/dist/vue/services/property-commands.d.ts +28 -0
  242. package/dist/vue/services/saved-blocks.d.ts +32 -0
  243. package/dist/vue/services/selection-path.d.ts +20 -0
  244. package/dist/vue/services/shortcuts.d.ts +39 -0
  245. package/dist/vue/services/structure-tree.d.ts +38 -0
  246. package/dist/vue/services/template-application.d.ts +33 -0
  247. package/dist/vue/services/tree-drag.d.ts +28 -0
  248. package/dist/vue/session/blocks.d.ts +44 -0
  249. package/dist/vue/session/guard.d.ts +13 -0
  250. package/dist/vue/session/structure.d.ts +36 -0
  251. package/dist/vue/session/text.d.ts +23 -0
  252. package/dist/vue/session/transfer.d.ts +23 -0
  253. package/dist/vue/theme.d.ts +20 -0
  254. package/dist/vue/variables.d.ts +21 -0
  255. package/dist/vue/workbench.d.ts +100 -0
  256. package/dist/vue.js +71418 -0
  257. package/dist/vue.js.map +1 -0
  258. package/package.json +125 -4
@@ -0,0 +1,78 @@
1
+ import { CssDocumentCodec } from '../codecs/css';
2
+ import type { DocumentKind, EditorDocumentData } from '../core/document';
3
+ import { ActiveMarkupRules } from './markup-rules';
4
+ import { SourceMarkup } from './source-markup';
5
+ /** A resource the document points to. `origin` is absent for relative URLs and merge tags. */
6
+ export interface ExternalReference {
7
+ readonly url: string;
8
+ readonly origin?: string;
9
+ }
10
+ /**
11
+ * What a document contains that a publisher may want to decide about. The package reports;
12
+ * the host applies its own rule. Counts include markup kept as source (conditional comments,
13
+ * `noscript`, `template`, inline SVG).
14
+ */
15
+ export interface ContentInventory {
16
+ readonly kind: DocumentKind;
17
+ readonly scripts: {
18
+ /** Executable scripts written in the document. */
19
+ readonly inline: number;
20
+ /** Executable scripts loaded by `src`. */
21
+ readonly external: readonly ExternalReference[];
22
+ /** `<script>` data blocks such as JSON-LD, which browsers do not run. */
23
+ readonly data: number;
24
+ };
25
+ /** `iframe` and `frame` sources. */
26
+ readonly frames: readonly ExternalReference[];
27
+ /** `object`, `embed` and `applet` elements. */
28
+ readonly embeds: number;
29
+ /** `<link rel="stylesheet">` and `@import` targets. */
30
+ readonly stylesheets: readonly ExternalReference[];
31
+ /** Every other `<link>`: fonts preconnect, icons, preloads. */
32
+ readonly links: readonly (ExternalReference & {
33
+ readonly rel: string;
34
+ })[];
35
+ readonly forms: {
36
+ readonly count: number;
37
+ readonly actions: readonly ExternalReference[];
38
+ };
39
+ /** `on*` attributes. */
40
+ readonly inlineHandlers: number;
41
+ /** `javascript:`, `vbscript:` and `data:` document URLs in attributes. */
42
+ readonly scriptUrls: number;
43
+ readonly metaRefresh: number;
44
+ readonly baseUrls: readonly string[];
45
+ /** Encodings declared by `<meta>`, lower case, as written. */
46
+ readonly charsets: readonly string[];
47
+ readonly fontFaces: number;
48
+ /** `expression()`, `behavior`, `-moz-binding` and code URLs inside CSS. */
49
+ readonly activeCss: number;
50
+ }
51
+ export type InventoryTopic = 'script' | 'embed' | 'stylesheet' | 'form' | 'handler' | 'charset';
52
+ export interface ContentSurvey {
53
+ readonly inventory: ContentInventory;
54
+ /** First document node of each topic, for a notice which can point at it. */
55
+ readonly anchors: Readonly<Partial<Record<InventoryTopic, string>>>;
56
+ }
57
+ /** Builds the typed inventory of a document. It never changes or refuses anything. */
58
+ export declare class ContentInspector {
59
+ #private;
60
+ constructor(css: CssDocumentCodec, rules: ActiveMarkupRules, sources?: SourceMarkup);
61
+ inspect(input: EditorDocumentData): ContentInventory;
62
+ /** The caller hands in a snapshot which already passed `EditorDocument.from`. */
63
+ survey(document: EditorDocumentData): ContentSurvey;
64
+ /** A conditional comment hides markup which Outlook, or an old browser, does render. */
65
+ conditional(value: string): boolean;
66
+ private source;
67
+ private element;
68
+ /**
69
+ * Most inline styles are plain declarations. Only one which could hold what the survey
70
+ * counts (a URL, a legacy expression or binding, or an escape hiding either) is parsed.
71
+ */
72
+ private mayBeActive;
73
+ private stylesheet;
74
+ /** The encoding a `<meta>` declares, by either syntax; undefined when it declares none. */
75
+ declaredCharset(attrs: Readonly<Record<string, string>>): string | undefined;
76
+ private reference;
77
+ private text;
78
+ }
@@ -0,0 +1,36 @@
1
+ import type { DocumentNode } from '../core/document';
2
+ import { ActiveMarkupRules } from './markup-rules';
3
+ import type { ActiveMarkup } from './markup-rules';
4
+ import { SourceMarkup } from './source-markup';
5
+ import type { ActiveStyleRemover } from './source-markup';
6
+ /** What was taken out of an e-mail, or rewritten in it. */
7
+ export type EmailRemoval = ActiveMarkup | 'charset';
8
+ export interface SanitizedEmail {
9
+ readonly nodes: readonly DocumentNode[];
10
+ /** One entry per occurrence; empty when the tree is returned untouched. */
11
+ readonly removed: readonly EmailRemoval[];
12
+ }
13
+ /**
14
+ * An e-mail never carries scripts, embedded documents, inline handlers, code URLs, CSS which
15
+ * would run code, a refresh or a `base`: no client runs them and several
16
+ * reject the whole message. They are removed,
17
+ * never refused. Elements leave with their content; an attribute leaves and its element stays;
18
+ * a declaration leaves and the rest of its style stays. Everything else, conditional comments
19
+ * and VML included, is kept as written.
20
+ */
21
+ export declare class EmailSanitizer {
22
+ #private;
23
+ constructor(rules?: ActiveMarkupRules, styles?: ActiveStyleRemover, sources?: SourceMarkup);
24
+ /** The panel CSS of the document, under the same rule as its style elements. */
25
+ stylesheet(css: string): {
26
+ readonly css: string;
27
+ readonly removed: readonly EmailRemoval[];
28
+ };
29
+ sanitize(nodes: readonly DocumentNode[]): SanitizedEmail;
30
+ private nodes;
31
+ private node;
32
+ /** Undefined when the block could not be made clean and is dropped as a whole. */
33
+ private source;
34
+ /** The source reaches the editor as decoded text; whatever it declared, it is UTF-8 now. */
35
+ private charset;
36
+ }
@@ -0,0 +1,6 @@
1
+ /** Cryptographic opaque identifiers, including nonces for the trusted preview bridge. */
2
+ export declare class SecureIdentifier {
3
+ private readonly random;
4
+ constructor(random?: Pick<Crypto, 'getRandomValues'> | undefined);
5
+ next(): string;
6
+ }
@@ -0,0 +1,31 @@
1
+ import { UrlPolicy } from './url-policy';
2
+ /** What an e-mail may not carry and a page is merely told it carries. */
3
+ export type ActiveMarkup = 'script' | 'embed' | 'handler' | 'url' | 'style';
4
+ /**
5
+ * One classification of markup which runs or loads code, shared by the inventory, the e-mail
6
+ * sanitizer and the scan of source kept as text. It decides nothing about publication.
7
+ */
8
+ export declare class ActiveMarkupRules {
9
+ private readonly urls;
10
+ constructor(urls?: UrlPolicy);
11
+ element(tag: string): Extract<ActiveMarkup, 'script' | 'embed'> | undefined;
12
+ /**
13
+ * An element which is only active because of what its attributes say together: an HTML
14
+ * import, a refresh to a code address, an animation which writes a code address into a link.
15
+ */
16
+ elementWith(tag: string, attributes: Readonly<Record<string, string>>): Extract<ActiveMarkup, 'embed' | 'url'> | undefined;
17
+ /**
18
+ * What sends an e-mail somewhere else or changes where its addresses point: any refresh
19
+ * (with or without a target) and any `base`. Removed from e-mails and never written by the
20
+ * editor; a page keeps them, as its author wrote them.
21
+ */
22
+ navigation(tag: string, attributes: Readonly<Record<string, string>>): 'url' | undefined;
23
+ attribute(name: string, value: string): Extract<ActiveMarkup, 'handler' | 'url'> | undefined;
24
+ /**
25
+ * `on` followed by letters only, as every handler is and as any future one will be. The rule
26
+ * for what the editor itself writes, which never needs an attribute of that shape.
27
+ */
28
+ handlerLike(name: string): boolean;
29
+ /** URL attributes and what each loads, for the strict rule of what the editor writes. */
30
+ urlPurpose(name: string): 'link' | 'image' | undefined;
31
+ }
@@ -0,0 +1,61 @@
1
+ import { CssDocumentCodec } from '../codecs/css';
2
+ import { EditorDocument } from '../core/document';
3
+ import type { Diagnostic, DocumentNode, EditorDocumentData } from '../core/document';
4
+ import type { ContentInventory } from './content-inventory';
5
+ import { UrlPolicy } from './url-policy';
6
+ export declare class ContentPolicyError extends Error {
7
+ readonly diagnostics: readonly Diagnostic[];
8
+ constructor(diagnostics: readonly Diagnostic[]);
9
+ }
10
+ export interface SanitizedDocument {
11
+ readonly document: EditorDocumentData;
12
+ /** Grouped warnings saying what was removed or rewritten; empty when nothing was. */
13
+ readonly diagnostics: readonly Diagnostic[];
14
+ }
15
+ /**
16
+ * The rules of a document by kind. The editor never refuses the author's work for what it
17
+ * contains:
18
+ *
19
+ * - a page keeps everything, scripts included, and `validate` only reports it (`info`);
20
+ * - an e-mail has scripts, embeds, inline handlers and code URLs removed by `sanitize` at
21
+ * every entry (source or JSON), with a grouped `warning`; if they are still present,
22
+ * `validate` reports an error, because only a caller which skipped `sanitize` gets there.
23
+ *
24
+ * `assertSafe` therefore means "structurally sound, within limits and following the rules
25
+ * of its kind". It does not mean "free of script": nothing of a document may run in the
26
+ * editor because of the sandboxed frame and its nonce CSP, not because of this class.
27
+ * Publication is the host's decision, taken over `inspect`.
28
+ */
29
+ export declare class ContentPolicy {
30
+ #private;
31
+ constructor(urls?: UrlPolicy, css?: CssDocumentCodec);
32
+ /** An `EditorDocument` was validated when it was built and is not parsed again. */
33
+ validate(input: EditorDocumentData | EditorDocument): readonly Diagnostic[];
34
+ assertSafe(document: EditorDocumentData | EditorDocument): void;
35
+ /**
36
+ * Applies the removals of the kind. A page is returned as it came. Throws
37
+ * `DocumentValidationError` when the input is not a document within the limits.
38
+ */
39
+ sanitize(input: EditorDocumentData | EditorDocument): SanitizedDocument;
40
+ /**
41
+ * What the editor itself may write through its commands (an attribute, a link, a text
42
+ * coming back from the editing frame), in either kind. It is stricter than what an author
43
+ * may import: no script or embed, no handler, and URLs only under the strict `UrlPolicy`.
44
+ */
45
+ writable(nodes: readonly DocumentNode[]): boolean;
46
+ /** The typed inventory a host uses to decide whether and how to publish the document. */
47
+ inspect(input: EditorDocumentData): ContentInventory;
48
+ private notices;
49
+ private snapshot;
50
+ /** Integrity of the tree itself: what no parser could have produced or written back. */
51
+ private structure;
52
+ /** A letter, then anything the tokenizer keeps in a tag name. */
53
+ private tagName;
54
+ /** Framework and merge syntaxes (`@click`, `:class`, `mc:edit`) are ordinary names. */
55
+ private attributeName;
56
+ private nameCharacters;
57
+ /** One entry per code: the first node it refers to and how many times it happened. */
58
+ private group;
59
+ private notice;
60
+ private error;
61
+ }
@@ -0,0 +1,317 @@
1
+ import * as v from 'valibot';
2
+ import type { SelectionPreview } from '../renderers/selection-preview';
3
+ declare const boundsSchema: v.StrictObjectSchema<{
4
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
5
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
6
+ readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
7
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
8
+ }, undefined>;
9
+ declare const viewportSchema: v.StrictObjectSchema<{
10
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
11
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
12
+ }, undefined>;
13
+ /** One block of text is far smaller than a document; refused before any costly validation. */
14
+ export declare const TEXT_PROJECTION_BYTES = 262144;
15
+ declare const textStateSchema: v.StrictObjectSchema<{
16
+ readonly marks: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["bold", "italic", "underline", "strike", "superscript", "subscript", "bulletList", "orderedList"], undefined>, undefined>, v.MaxLengthAction<("bold" | "italic" | "underline" | "strike" | "superscript" | "subscript" | "bulletList" | "orderedList")[], 8, undefined>]>;
17
+ readonly styles: v.StrictObjectSchema<{
18
+ readonly color: v.StrictObjectSchema<{
19
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
20
+ readonly own: v.BooleanSchema<undefined>;
21
+ readonly mixed: v.BooleanSchema<undefined>;
22
+ }, undefined>;
23
+ readonly backgroundColor: v.StrictObjectSchema<{
24
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
25
+ readonly own: v.BooleanSchema<undefined>;
26
+ readonly mixed: v.BooleanSchema<undefined>;
27
+ }, undefined>;
28
+ readonly fontFamily: v.StrictObjectSchema<{
29
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
30
+ readonly own: v.BooleanSchema<undefined>;
31
+ readonly mixed: v.BooleanSchema<undefined>;
32
+ }, undefined>;
33
+ readonly fontSize: v.StrictObjectSchema<{
34
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
35
+ readonly own: v.BooleanSchema<undefined>;
36
+ readonly mixed: v.BooleanSchema<undefined>;
37
+ }, undefined>;
38
+ readonly lineHeight: v.StrictObjectSchema<{
39
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
40
+ readonly own: v.BooleanSchema<undefined>;
41
+ readonly mixed: v.BooleanSchema<undefined>;
42
+ }, undefined>;
43
+ }, undefined>;
44
+ readonly link: v.BooleanSchema<undefined>;
45
+ readonly href: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>]>;
46
+ readonly empty: v.BooleanSchema<undefined>;
47
+ readonly canUndo: v.BooleanSchema<undefined>;
48
+ readonly canRedo: v.BooleanSchema<undefined>;
49
+ readonly rect: v.StrictObjectSchema<{
50
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
51
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
52
+ readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
53
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
54
+ }, undefined>;
55
+ }, undefined>;
56
+ declare const canvasSchema: v.VariantSchema<"type", [v.StrictObjectSchema<{
57
+ readonly challenge: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
58
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
59
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
60
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
61
+ readonly type: v.LiteralSchema<"ready", undefined>;
62
+ }, undefined>, v.StrictObjectSchema<{
63
+ readonly viewport: v.StrictObjectSchema<{
64
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
65
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
66
+ }, undefined>;
67
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
68
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
69
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
70
+ readonly type: v.LiteralSchema<"viewport", undefined>;
71
+ }, undefined>, v.StrictObjectSchema<{
72
+ readonly viewport: v.StrictObjectSchema<{
73
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
74
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
75
+ }, undefined>;
76
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
77
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
78
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
79
+ readonly type: v.LiteralSchema<"viewport-restored", undefined>;
80
+ }, undefined>, v.StrictObjectSchema<{
81
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
82
+ readonly bounds: v.StrictObjectSchema<{
83
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
84
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
85
+ readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
86
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
87
+ }, undefined>;
88
+ readonly viewport: v.StrictObjectSchema<{
89
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
90
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000000, undefined>]>;
91
+ }, undefined>;
92
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
93
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
94
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
95
+ readonly type: v.LiteralSchema<"geometry", undefined>;
96
+ }, undefined>, v.StrictObjectSchema<{
97
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
98
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
99
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
100
+ readonly type: v.LiteralSchema<"morph-failed", undefined>;
101
+ }, undefined>, v.StrictObjectSchema<{
102
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
103
+ readonly style: v.StrictObjectSchema<{
104
+ readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 160, undefined>]>;
105
+ readonly lineHeight: v.UnionSchema<[v.LiteralSchema<"normal", undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 500, undefined>]>], undefined>;
106
+ readonly weight: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 900, undefined>]>;
107
+ readonly color: v.TupleSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 255, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 255, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 255, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>], undefined>;
108
+ readonly family: v.PicklistSchema<["sans-serif", "serif", "monospace"], undefined>;
109
+ readonly font: v.ExactOptionalSchema<v.PicklistSchema<readonly ["Arial", "Georgia", "Verdana", "Tahoma", "Trebuchet MS", "Times New Roman", "Courier New", "system-ui", "sans-serif", "serif", "monospace"], undefined>, undefined>;
110
+ readonly align: v.PicklistSchema<["left", "right", "center", "justify"], undefined>;
111
+ readonly direction: v.PicklistSchema<["ltr", "rtl"], undefined>;
112
+ }, undefined>;
113
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
114
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
115
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
116
+ readonly type: v.LiteralSchema<"appearance", undefined>;
117
+ }, undefined>, v.StrictObjectSchema<{
118
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
119
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
120
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
121
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
122
+ readonly type: v.LiteralSchema<"text-unsupported", undefined>;
123
+ }, undefined>, v.StrictObjectSchema<{
124
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
125
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
126
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
127
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
128
+ readonly type: v.LiteralSchema<"text-toolbar", undefined>;
129
+ }, undefined>, v.StrictObjectSchema<{
130
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
131
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
132
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
133
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
134
+ readonly type: v.LiteralSchema<"text-begin", undefined>;
135
+ }, undefined>, v.StrictObjectSchema<{
136
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
137
+ readonly html: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 262144, undefined>]>;
138
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
139
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
140
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
141
+ readonly type: v.LiteralSchema<"text-draft", undefined>;
142
+ }, undefined>, v.StrictObjectSchema<{
143
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
144
+ readonly html: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 262144, undefined>]>;
145
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
146
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
147
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
148
+ readonly type: v.LiteralSchema<"text-commit", undefined>;
149
+ }, undefined>, v.StrictObjectSchema<{
150
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
151
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
152
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
153
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
154
+ readonly type: v.LiteralSchema<"text-cancel", undefined>;
155
+ }, undefined>, v.StrictObjectSchema<{
156
+ readonly marks: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["bold", "italic", "underline", "strike", "superscript", "subscript", "bulletList", "orderedList"], undefined>, undefined>, v.MaxLengthAction<("bold" | "italic" | "underline" | "strike" | "superscript" | "subscript" | "bulletList" | "orderedList")[], 8, undefined>]>;
157
+ readonly styles: v.StrictObjectSchema<{
158
+ readonly color: v.StrictObjectSchema<{
159
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
160
+ readonly own: v.BooleanSchema<undefined>;
161
+ readonly mixed: v.BooleanSchema<undefined>;
162
+ }, undefined>;
163
+ readonly backgroundColor: v.StrictObjectSchema<{
164
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
165
+ readonly own: v.BooleanSchema<undefined>;
166
+ readonly mixed: v.BooleanSchema<undefined>;
167
+ }, undefined>;
168
+ readonly fontFamily: v.StrictObjectSchema<{
169
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
170
+ readonly own: v.BooleanSchema<undefined>;
171
+ readonly mixed: v.BooleanSchema<undefined>;
172
+ }, undefined>;
173
+ readonly fontSize: v.StrictObjectSchema<{
174
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
175
+ readonly own: v.BooleanSchema<undefined>;
176
+ readonly mixed: v.BooleanSchema<undefined>;
177
+ }, undefined>;
178
+ readonly lineHeight: v.StrictObjectSchema<{
179
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
180
+ readonly own: v.BooleanSchema<undefined>;
181
+ readonly mixed: v.BooleanSchema<undefined>;
182
+ }, undefined>;
183
+ }, undefined>;
184
+ readonly link: v.BooleanSchema<undefined>;
185
+ readonly href: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>]>;
186
+ readonly empty: v.BooleanSchema<undefined>;
187
+ readonly canUndo: v.BooleanSchema<undefined>;
188
+ readonly canRedo: v.BooleanSchema<undefined>;
189
+ readonly rect: v.StrictObjectSchema<{
190
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
191
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
192
+ readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
193
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
194
+ }, undefined>;
195
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
196
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
197
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
198
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
199
+ readonly type: v.LiteralSchema<"text-state", undefined>;
200
+ }, undefined>, v.StrictObjectSchema<{
201
+ readonly direction: v.PicklistSchema<["undo", "redo"], undefined>;
202
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
203
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
204
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
205
+ readonly type: v.LiteralSchema<"history", undefined>;
206
+ }, undefined>, v.StrictObjectSchema<{
207
+ readonly changed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
208
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
209
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
210
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
211
+ readonly type: v.LiteralSchema<"text-fidelity", undefined>;
212
+ }, undefined>, v.StrictObjectSchema<{
213
+ readonly sourceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
214
+ readonly targetId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
215
+ readonly placement: v.PicklistSchema<["before", "after", "inside"], undefined>;
216
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
217
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
218
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
219
+ readonly type: v.LiteralSchema<"move", undefined>;
220
+ }, undefined>, v.StrictObjectSchema<{
221
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
222
+ readonly action: v.PicklistSchema<readonly ["duplicate", "remove", "up", "down", "html", "image"], undefined>;
223
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
224
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
225
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
226
+ readonly type: v.LiteralSchema<"action", undefined>;
227
+ }, undefined>, v.StrictObjectSchema<{
228
+ readonly targetId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
229
+ readonly placement: v.PicklistSchema<["before", "after", "inside"], undefined>;
230
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
231
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
232
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
233
+ readonly type: v.LiteralSchema<"insertion", undefined>;
234
+ }, undefined>, v.StrictObjectSchema<{
235
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
236
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
237
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
238
+ readonly type: v.LiteralSchema<"insertion-end", undefined>;
239
+ }, undefined>, v.StrictObjectSchema<{
240
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
241
+ readonly bounds: v.StrictObjectSchema<{
242
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
243
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, -100000, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
244
+ readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
245
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
246
+ }, undefined>;
247
+ readonly keyboard: v.ExactOptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
248
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
249
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
250
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
251
+ readonly type: v.LiteralSchema<"insert-request", undefined>;
252
+ }, undefined>, v.StrictObjectSchema<{
253
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
254
+ readonly x: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
255
+ readonly y: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100000, undefined>]>;
256
+ readonly keyboard: v.ExactOptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
257
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
258
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
259
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
260
+ readonly type: v.LiteralSchema<"context-menu", undefined>;
261
+ }, undefined>, v.StrictObjectSchema<{
262
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
263
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
264
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
265
+ readonly type: v.LiteralSchema<"file-drag", undefined>;
266
+ }, undefined>, v.StrictObjectSchema<{
267
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
268
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
269
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
270
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
271
+ readonly type: v.LiteralSchema<"image-drop", undefined>;
272
+ }, undefined>, v.StrictObjectSchema<{
273
+ readonly command: v.PicklistSchema<["save"], undefined>;
274
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
275
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
276
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
277
+ readonly type: v.LiteralSchema<"shortcut", undefined>;
278
+ }, undefined>, v.StrictObjectSchema<{
279
+ readonly nodeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
280
+ readonly width: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4000, undefined>]>;
281
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4000, undefined>]>;
282
+ readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
283
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
284
+ readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>;
285
+ readonly type: v.LiteralSchema<"image-resize", undefined>;
286
+ }, undefined>], undefined>;
287
+ export type CanvasBounds = v.InferOutput<typeof boundsSchema>;
288
+ export type CanvasViewport = v.InferOutput<typeof viewportSchema>;
289
+ export type CanvasEvent = v.InferOutput<typeof canvasSchema>;
290
+ export type CanvasTextState = v.InferOutput<typeof textStateSchema>;
291
+ type MessageClass = 'telemetry' | 'control' | 'intent' | 'mutation' | 'draft' | 'shortcut';
292
+ /** What the host knows and the frame cannot be trusted to say. */
293
+ export interface PreviewHostState {
294
+ /** The block selected in the host; a block is only changed from the piece while selected. */
295
+ readonly selectedNodeId?: string | undefined;
296
+ /** The block selected before it, for a second at most after the selection moved. */
297
+ readonly recentNodeId?: string | undefined;
298
+ }
299
+ /**
300
+ * Messages accepted per second, by class. Measurements repeat every frame and may be dropped;
301
+ * they never spend the allowance of handshakes or of what the person asked for. Mutations are
302
+ * intents too and keep their own lower ceiling.
303
+ */
304
+ export declare const PREVIEW_MESSAGE_BUDGETS: Readonly<Record<MessageClass, number>>;
305
+ /** Authenticates the bridge and accepts only bounded intents against the current capabilities. */
306
+ export declare class PreviewMessagePolicy {
307
+ #private;
308
+ private readonly clock;
309
+ private readonly budget;
310
+ constructor(clock?: () => number);
311
+ private static unspent;
312
+ private withinBudget;
313
+ private classify;
314
+ selection(data: unknown, source: unknown, expectedSource: unknown, preview: SelectionPreview): string | undefined;
315
+ canvas(data: unknown, source: unknown, expectedSource: unknown, preview: SelectionPreview, host?: PreviewHostState): CanvasEvent | undefined;
316
+ }
317
+ export {};
@@ -0,0 +1,19 @@
1
+ import { UrlPolicy } from './url-policy';
2
+ export interface RichTextProjectionResult {
3
+ readonly html: string;
4
+ readonly adjusted: boolean;
5
+ }
6
+ /** An inert parse5 projection is the only markup accepted by the authenticated rich-text DOM. */
7
+ export declare class RichTextProjection {
8
+ private readonly urls;
9
+ private readonly budget;
10
+ private readonly formats;
11
+ private readonly inline;
12
+ private readonly blocks;
13
+ private readonly discarded;
14
+ /** A text nests far less than a document; the parse ends as soon as it goes beyond that. */
15
+ private readonly parser;
16
+ private readonly styles;
17
+ constructor(urls?: UrlPolicy);
18
+ project(source: string, allowBlocks?: boolean): RichTextProjectionResult;
19
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SHA-256 of the UTF-8 form of a text, in base64: the value of a CSP `'sha256-…'` source. The
3
+ * preview is built synchronously and Web Crypto only digests asynchronously, so the few lines of
4
+ * the algorithm live here. It authorizes a script by its exact text; it protects no secret.
5
+ */
6
+ export declare function sha256Base64(text: string): string;