@prismicio/client 7.7.3 → 7.7.5-alpha.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/README.md +3 -3
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.cjs +63 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.cjs.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.js +63 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.js.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/index.cjs +12 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/index.cjs.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/index.js +12 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/index.js.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.cjs +127 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.cjs.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.js +127 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.js.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/types.cjs +23 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/types.cjs.map +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/types.js +23 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/types.js.map +1 -0
- package/dist/_node_modules/bail/index.cjs +9 -0
- package/dist/_node_modules/bail/index.cjs.map +1 -0
- package/dist/_node_modules/bail/index.js +9 -0
- package/dist/_node_modules/bail/index.js.map +1 -0
- package/dist/_node_modules/bcp-47-match/index.cjs +74 -0
- package/dist/_node_modules/bcp-47-match/index.cjs.map +1 -0
- package/dist/_node_modules/bcp-47-match/index.js +74 -0
- package/dist/_node_modules/bcp-47-match/index.js.map +1 -0
- package/dist/_node_modules/boolbase/index.cjs +13 -0
- package/dist/_node_modules/boolbase/index.cjs.map +1 -0
- package/dist/_node_modules/boolbase/index.js +14 -0
- package/dist/_node_modules/boolbase/index.js.map +1 -0
- package/dist/_node_modules/ccount/index.cjs +17 -0
- package/dist/_node_modules/ccount/index.cjs.map +1 -0
- package/dist/_node_modules/ccount/index.js +17 -0
- package/dist/_node_modules/ccount/index.js.map +1 -0
- package/dist/_node_modules/character-entities/index.cjs +2131 -0
- package/dist/_node_modules/character-entities/index.cjs.map +1 -0
- package/dist/_node_modules/character-entities/index.js +2131 -0
- package/dist/_node_modules/character-entities/index.js.map +1 -0
- package/dist/_node_modules/character-entities-html4/index.cjs +258 -0
- package/dist/_node_modules/character-entities-html4/index.cjs.map +1 -0
- package/dist/_node_modules/character-entities-html4/index.js +258 -0
- package/dist/_node_modules/character-entities-html4/index.js.map +1 -0
- package/dist/_node_modules/character-entities-legacy/index.cjs +112 -0
- package/dist/_node_modules/character-entities-legacy/index.cjs.map +1 -0
- package/dist/_node_modules/character-entities-legacy/index.js +112 -0
- package/dist/_node_modules/character-entities-legacy/index.js.map +1 -0
- package/dist/_node_modules/comma-separated-tokens/index.cjs +32 -0
- package/dist/_node_modules/comma-separated-tokens/index.cjs.map +1 -0
- package/dist/_node_modules/comma-separated-tokens/index.js +32 -0
- package/dist/_node_modules/comma-separated-tokens/index.js.map +1 -0
- package/dist/_node_modules/devlop/lib/default.cjs +6 -0
- package/dist/_node_modules/devlop/lib/default.cjs.map +1 -0
- package/dist/_node_modules/devlop/lib/default.js +6 -0
- package/dist/_node_modules/devlop/lib/default.js.map +1 -0
- package/dist/_node_modules/direction/index.cjs +12 -0
- package/dist/_node_modules/direction/index.cjs.map +1 -0
- package/dist/_node_modules/direction/index.js +12 -0
- package/dist/_node_modules/direction/index.js.map +1 -0
- package/dist/_node_modules/extend/index.cjs +89 -0
- package/dist/_node_modules/extend/index.cjs.map +1 -0
- package/dist/_node_modules/extend/index.js +90 -0
- package/dist/_node_modules/extend/index.js.map +1 -0
- package/dist/_node_modules/hast-util-embedded/lib/index.cjs +14 -0
- package/dist/_node_modules/hast-util-embedded/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-embedded/lib/index.js +14 -0
- package/dist/_node_modules/hast-util-embedded/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-from-html/lib/errors.cjs +317 -0
- package/dist/_node_modules/hast-util-from-html/lib/errors.cjs.map +1 -0
- package/dist/_node_modules/hast-util-from-html/lib/errors.js +317 -0
- package/dist/_node_modules/hast-util-from-html/lib/errors.js.map +1 -0
- package/dist/_node_modules/hast-util-from-html/lib/index.cjs +96 -0
- package/dist/_node_modules/hast-util-from-html/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-from-html/lib/index.js +96 -0
- package/dist/_node_modules/hast-util-from-html/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-from-parse5/lib/index.cjs +187 -0
- package/dist/_node_modules/hast-util-from-parse5/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-from-parse5/lib/index.js +187 -0
- package/dist/_node_modules/hast-util-from-parse5/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-has-property/lib/index.cjs +9 -0
- package/dist/_node_modules/hast-util-has-property/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-has-property/lib/index.js +9 -0
- package/dist/_node_modules/hast-util-has-property/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-is-element/lib/index.cjs +102 -0
- package/dist/_node_modules/hast-util-is-element/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-is-element/lib/index.js +102 -0
- package/dist/_node_modules/hast-util-is-element/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-parse-selector/lib/index.cjs +40 -0
- package/dist/_node_modules/hast-util-parse-selector/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-parse-selector/lib/index.js +40 -0
- package/dist/_node_modules/hast-util-parse-selector/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/attribute.cjs +67 -0
- package/dist/_node_modules/hast-util-select/lib/attribute.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/attribute.js +67 -0
- package/dist/_node_modules/hast-util-select/lib/attribute.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/class-name.cjs +12 -0
- package/dist/_node_modules/hast-util-select/lib/class-name.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/class-name.js +12 -0
- package/dist/_node_modules/hast-util-select/lib/class-name.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/enter-state.cjs +79 -0
- package/dist/_node_modules/hast-util-select/lib/enter-state.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/enter-state.js +79 -0
- package/dist/_node_modules/hast-util-select/lib/enter-state.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/id.cjs +7 -0
- package/dist/_node_modules/hast-util-select/lib/id.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/id.js +7 -0
- package/dist/_node_modules/hast-util-select/lib/id.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/index.cjs +38 -0
- package/dist/_node_modules/hast-util-select/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/index.js +38 -0
- package/dist/_node_modules/hast-util-select/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/name.cjs +7 -0
- package/dist/_node_modules/hast-util-select/lib/name.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/name.js +7 -0
- package/dist/_node_modules/hast-util-select/lib/name.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/parse.cjs +12 -0
- package/dist/_node_modules/hast-util-select/lib/parse.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/parse.js +12 -0
- package/dist/_node_modules/hast-util-select/lib/parse.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/pseudo.cjs +231 -0
- package/dist/_node_modules/hast-util-select/lib/pseudo.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/pseudo.js +231 -0
- package/dist/_node_modules/hast-util-select/lib/pseudo.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/test.cjs +27 -0
- package/dist/_node_modules/hast-util-select/lib/test.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/test.js +27 -0
- package/dist/_node_modules/hast-util-select/lib/test.js.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/walk.cjs +132 -0
- package/dist/_node_modules/hast-util-select/lib/walk.cjs.map +1 -0
- package/dist/_node_modules/hast-util-select/lib/walk.js +132 -0
- package/dist/_node_modules/hast-util-select/lib/walk.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.cjs +24 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.js +24 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.cjs +7 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.js +7 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.cjs +137 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.js +137 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.cjs +26 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.js +26 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.cjs +8 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.js +8 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.cjs +7 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.js +7 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.cjs +14 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.js +14 -0
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/index.cjs +62 -0
- package/dist/_node_modules/hast-util-to-html/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/index.js +62 -0
- package/dist/_node_modules/hast-util-to-html/lib/index.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.cjs +92 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.js +92 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.cjs +11 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.js +11 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.cjs +52 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.js +52 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.js.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.cjs +24 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.js +24 -0
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.js.map +1 -0
- package/dist/_node_modules/hast-util-to-string/lib/index.cjs +24 -0
- package/dist/_node_modules/hast-util-to-string/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hast-util-to-string/lib/index.js +24 -0
- package/dist/_node_modules/hast-util-to-string/lib/index.js.map +1 -0
- package/dist/_node_modules/hastscript/lib/create-h.cjs +159 -0
- package/dist/_node_modules/hastscript/lib/create-h.cjs.map +1 -0
- package/dist/_node_modules/hastscript/lib/create-h.js +159 -0
- package/dist/_node_modules/hastscript/lib/create-h.js.map +1 -0
- package/dist/_node_modules/hastscript/lib/index.cjs +10 -0
- package/dist/_node_modules/hastscript/lib/index.cjs.map +1 -0
- package/dist/_node_modules/hastscript/lib/index.js +10 -0
- package/dist/_node_modules/hastscript/lib/index.js.map +1 -0
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +45 -0
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.map +1 -0
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +45 -0
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.js.map +1 -0
- package/dist/_node_modules/html-void-elements/index.cjs +26 -0
- package/dist/_node_modules/html-void-elements/index.cjs.map +1 -0
- package/dist/_node_modules/html-void-elements/index.js +26 -0
- package/dist/_node_modules/html-void-elements/index.js.map +1 -0
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.cjs +720 -0
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.js +720 -0
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.cjs +116 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.js +116 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.cjs +9 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.js +9 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.cjs +25 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.js +25 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs +42 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +42 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.cjs +12 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.js +12 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs +20 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +20 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.cjs +17 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.js +17 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.cjs +60 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.js +60 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs +16 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +16 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs +25 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +25 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.cjs +19 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.js +19 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs +65 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.js +65 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.cjs +27 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.js +27 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.cjs +9 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.js +9 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs +15 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +15 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs +36 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.js +36 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.cjs +40 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.js +40 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.cjs +10 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.js +10 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +14 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/index.cjs +16 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/index.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/index.js +16 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/index.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.cjs +30 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.js +30 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/state.cjs +149 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/state.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/state.js +149 -0
- package/dist/_node_modules/mdast-util-to-hast/lib/state.js.map +1 -0
- package/dist/_node_modules/mdast-util-to-string/lib/index.cjs +39 -0
- package/dist/_node_modules/mdast-util-to-string/lib/index.cjs.map +1 -0
- package/dist/_node_modules/mdast-util-to-string/lib/index.js +39 -0
- package/dist/_node_modules/mdast-util-to-string/lib/index.js.map +1 -0
- package/dist/_node_modules/micromark/lib/constructs.cjs +94 -0
- package/dist/_node_modules/micromark/lib/constructs.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/constructs.js +94 -0
- package/dist/_node_modules/micromark/lib/constructs.js.map +1 -0
- package/dist/_node_modules/micromark/lib/create-tokenizer.cjs +316 -0
- package/dist/_node_modules/micromark/lib/create-tokenizer.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/create-tokenizer.js +316 -0
- package/dist/_node_modules/micromark/lib/create-tokenizer.js.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/content.cjs +58 -0
- package/dist/_node_modules/micromark/lib/initialize/content.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/content.js +58 -0
- package/dist/_node_modules/micromark/lib/initialize/content.js.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/document.cjs +212 -0
- package/dist/_node_modules/micromark/lib/initialize/document.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/document.js +212 -0
- package/dist/_node_modules/micromark/lib/initialize/document.js.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/flow.cjs +55 -0
- package/dist/_node_modules/micromark/lib/initialize/flow.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/flow.js +55 -0
- package/dist/_node_modules/micromark/lib/initialize/flow.js.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/text.cjs +143 -0
- package/dist/_node_modules/micromark/lib/initialize/text.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/initialize/text.js +143 -0
- package/dist/_node_modules/micromark/lib/initialize/text.js.map +1 -0
- package/dist/_node_modules/micromark/lib/parse.cjs +35 -0
- package/dist/_node_modules/micromark/lib/parse.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/parse.js +35 -0
- package/dist/_node_modules/micromark/lib/parse.js.map +1 -0
- package/dist/_node_modules/micromark/lib/postprocess.cjs +10 -0
- package/dist/_node_modules/micromark/lib/postprocess.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/postprocess.js +10 -0
- package/dist/_node_modules/micromark/lib/postprocess.js.map +1 -0
- package/dist/_node_modules/micromark/lib/preprocess.cjs +81 -0
- package/dist/_node_modules/micromark/lib/preprocess.cjs.map +1 -0
- package/dist/_node_modules/micromark/lib/preprocess.js +81 -0
- package/dist/_node_modules/micromark/lib/preprocess.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.cjs +116 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.js +116 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.cjs +104 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.js +104 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.cjs +19 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.js +19 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.cjs +62 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.js +62 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.cjs +29 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.js +29 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.cjs +69 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.js +69 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.cjs +187 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.js +187 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.cjs +68 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.js +68 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.cjs +117 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.js +117 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/content.cjs +76 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/content.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/content.js +76 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.cjs +95 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.js +95 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs +24 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.js +24 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.cjs +96 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.js +96 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.cjs +384 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.js +384 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.cjs +310 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.js +310 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.cjs +219 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.js +219 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.cjs +34 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.js +34 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.cjs +25 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.js +25 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.cjs +18 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.js +18 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/list.cjs +136 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/list.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/list.js +136 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.cjs +90 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.js +90 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.cjs +43 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.cjs.map +1 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.js +43 -0
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
- package/dist/_node_modules/micromark-factory-destination/index.cjs +95 -0
- package/dist/_node_modules/micromark-factory-destination/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-factory-destination/index.js +95 -0
- package/dist/_node_modules/micromark-factory-destination/index.js.map +1 -0
- package/dist/_node_modules/micromark-factory-label/index.cjs +64 -0
- package/dist/_node_modules/micromark-factory-label/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-factory-label/index.js +64 -0
- package/dist/_node_modules/micromark-factory-label/index.js.map +1 -0
- package/dist/_node_modules/micromark-factory-space/index.cjs +25 -0
- package/dist/_node_modules/micromark-factory-space/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-factory-space/index.js +25 -0
- package/dist/_node_modules/micromark-factory-space/index.js.map +1 -0
- package/dist/_node_modules/micromark-factory-title/index.cjs +66 -0
- package/dist/_node_modules/micromark-factory-title/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-factory-title/index.js +66 -0
- package/dist/_node_modules/micromark-factory-title/index.js.map +1 -0
- package/dist/_node_modules/micromark-factory-whitespace/index.cjs +27 -0
- package/dist/_node_modules/micromark-factory-whitespace/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-factory-whitespace/index.js +27 -0
- package/dist/_node_modules/micromark-factory-whitespace/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-character/index.cjs +45 -0
- package/dist/_node_modules/micromark-util-character/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-character/index.js +45 -0
- package/dist/_node_modules/micromark-util-character/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-chunked/index.cjs +37 -0
- package/dist/_node_modules/micromark-util-chunked/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-chunked/index.js +37 -0
- package/dist/_node_modules/micromark-util-chunked/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-classify-character/index.cjs +13 -0
- package/dist/_node_modules/micromark-util-classify-character/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-classify-character/index.js +13 -0
- package/dist/_node_modules/micromark-util-classify-character/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-combine-extensions/index.cjs +42 -0
- package/dist/_node_modules/micromark-util-combine-extensions/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-combine-extensions/index.js +42 -0
- package/dist/_node_modules/micromark-util-combine-extensions/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.cjs +20 -0
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.js +20 -0
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-decode-string/index.cjs +22 -0
- package/dist/_node_modules/micromark-util-decode-string/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-decode-string/index.js +22 -0
- package/dist/_node_modules/micromark-util-decode-string/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-html-tag-name/index.cjs +70 -0
- package/dist/_node_modules/micromark-util-html-tag-name/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-html-tag-name/index.js +70 -0
- package/dist/_node_modules/micromark-util-html-tag-name/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-normalize-identifier/index.cjs +7 -0
- package/dist/_node_modules/micromark-util-normalize-identifier/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-normalize-identifier/index.js +7 -0
- package/dist/_node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-resolve-all/index.cjs +16 -0
- package/dist/_node_modules/micromark-util-resolve-all/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-resolve-all/index.js +16 -0
- package/dist/_node_modules/micromark-util-resolve-all/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-sanitize-uri/index.cjs +42 -0
- package/dist/_node_modules/micromark-util-sanitize-uri/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-sanitize-uri/index.js +42 -0
- package/dist/_node_modules/micromark-util-sanitize-uri/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-subtokenize/index.cjs +149 -0
- package/dist/_node_modules/micromark-util-subtokenize/index.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-subtokenize/index.js +149 -0
- package/dist/_node_modules/micromark-util-subtokenize/index.js.map +1 -0
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs +195 -0
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs.map +1 -0
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.js +195 -0
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.js.map +1 -0
- package/dist/_node_modules/nth-check/lib/esm/compile.cjs +20 -0
- package/dist/_node_modules/nth-check/lib/esm/compile.cjs.map +1 -0
- package/dist/_node_modules/nth-check/lib/esm/compile.js +20 -0
- package/dist/_node_modules/nth-check/lib/esm/compile.js.map +1 -0
- package/dist/_node_modules/nth-check/lib/esm/index.cjs +11 -0
- package/dist/_node_modules/nth-check/lib/esm/index.cjs.map +1 -0
- package/dist/_node_modules/nth-check/lib/esm/index.js +11 -0
- package/dist/_node_modules/nth-check/lib/esm/index.js.map +1 -0
- package/dist/_node_modules/nth-check/lib/esm/parse.cjs +59 -0
- package/dist/_node_modules/nth-check/lib/esm/parse.cjs.map +1 -0
- package/dist/_node_modules/nth-check/lib/esm/parse.js +59 -0
- package/dist/_node_modules/nth-check/lib/esm/parse.js.map +1 -0
- package/dist/_node_modules/property-information/index.cjs +14 -0
- package/dist/_node_modules/property-information/index.cjs.map +1 -0
- package/dist/_node_modules/property-information/index.js +14 -0
- package/dist/_node_modules/property-information/index.js.map +1 -0
- package/dist/_node_modules/property-information/lib/aria.cjs +62 -0
- package/dist/_node_modules/property-information/lib/aria.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/aria.js +62 -0
- package/dist/_node_modules/property-information/lib/aria.js.map +1 -0
- package/dist/_node_modules/property-information/lib/find.cjs +41 -0
- package/dist/_node_modules/property-information/lib/find.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/find.js +41 -0
- package/dist/_node_modules/property-information/lib/find.js.map +1 -0
- package/dist/_node_modules/property-information/lib/html.cjs +369 -0
- package/dist/_node_modules/property-information/lib/html.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/html.js +369 -0
- package/dist/_node_modules/property-information/lib/html.js.map +1 -0
- package/dist/_node_modules/property-information/lib/normalize.cjs +7 -0
- package/dist/_node_modules/property-information/lib/normalize.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/normalize.js +7 -0
- package/dist/_node_modules/property-information/lib/normalize.js.map +1 -0
- package/dist/_node_modules/property-information/lib/svg.cjs +567 -0
- package/dist/_node_modules/property-information/lib/svg.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/svg.js +567 -0
- package/dist/_node_modules/property-information/lib/svg.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.cjs +8 -0
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.js +8 -0
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.cjs +7 -0
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.js +7 -0
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/create.cjs +31 -0
- package/dist/_node_modules/property-information/lib/util/create.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/create.js +31 -0
- package/dist/_node_modules/property-information/lib/util/create.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/defined-info.cjs +33 -0
- package/dist/_node_modules/property-information/lib/util/defined-info.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/defined-info.js +33 -0
- package/dist/_node_modules/property-information/lib/util/defined-info.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/info.cjs +25 -0
- package/dist/_node_modules/property-information/lib/util/info.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/info.js +25 -0
- package/dist/_node_modules/property-information/lib/util/info.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/merge.cjs +15 -0
- package/dist/_node_modules/property-information/lib/util/merge.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/merge.js +15 -0
- package/dist/_node_modules/property-information/lib/util/merge.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/schema.cjs +22 -0
- package/dist/_node_modules/property-information/lib/util/schema.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/schema.js +22 -0
- package/dist/_node_modules/property-information/lib/util/schema.js.map +1 -0
- package/dist/_node_modules/property-information/lib/util/types.cjs +21 -0
- package/dist/_node_modules/property-information/lib/util/types.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/util/types.js +21 -0
- package/dist/_node_modules/property-information/lib/util/types.js.map +1 -0
- package/dist/_node_modules/property-information/lib/xlink.cjs +20 -0
- package/dist/_node_modules/property-information/lib/xlink.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/xlink.js +20 -0
- package/dist/_node_modules/property-information/lib/xlink.js.map +1 -0
- package/dist/_node_modules/property-information/lib/xml.cjs +12 -0
- package/dist/_node_modules/property-information/lib/xml.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/xml.js +12 -0
- package/dist/_node_modules/property-information/lib/xml.js.map +1 -0
- package/dist/_node_modules/property-information/lib/xmlns.cjs +12 -0
- package/dist/_node_modules/property-information/lib/xmlns.cjs.map +1 -0
- package/dist/_node_modules/property-information/lib/xmlns.js +12 -0
- package/dist/_node_modules/property-information/lib/xmlns.js.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.cjs +122 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.cjs.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.js +122 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.js.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.cjs +11 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.cjs.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.js +11 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.js.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.cjs +169 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.cjs.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.js +170 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.js.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.cjs +24 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.cjs.map +1 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.js +24 -0
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.js.map +1 -0
- package/dist/_node_modules/rehype-parse/lib/index.cjs +21 -0
- package/dist/_node_modules/rehype-parse/lib/index.cjs.map +1 -0
- package/dist/_node_modules/rehype-parse/lib/index.js +22 -0
- package/dist/_node_modules/rehype-parse/lib/index.js.map +1 -0
- package/dist/_node_modules/remark-parse/lib/index.cjs +19 -0
- package/dist/_node_modules/remark-parse/lib/index.cjs.map +1 -0
- package/dist/_node_modules/remark-parse/lib/index.js +20 -0
- package/dist/_node_modules/remark-parse/lib/index.js.map +1 -0
- package/dist/_node_modules/remark-rehype/lib/index.cjs +21 -0
- package/dist/_node_modules/remark-rehype/lib/index.cjs.map +1 -0
- package/dist/_node_modules/remark-rehype/lib/index.js +22 -0
- package/dist/_node_modules/remark-rehype/lib/index.js.map +1 -0
- package/dist/_node_modules/space-separated-tokens/index.cjs +12 -0
- package/dist/_node_modules/space-separated-tokens/index.cjs.map +1 -0
- package/dist/_node_modules/space-separated-tokens/index.js +12 -0
- package/dist/_node_modules/space-separated-tokens/index.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.cjs +14 -0
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.js +14 -0
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/core.cjs +52 -0
- package/dist/_node_modules/stringify-entities/lib/core.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/core.js +52 -0
- package/dist/_node_modules/stringify-entities/lib/core.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/index.cjs +9 -0
- package/dist/_node_modules/stringify-entities/lib/index.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/index.js +9 -0
- package/dist/_node_modules/stringify-entities/lib/index.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.cjs +26 -0
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.js +26 -0
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.cjs +9 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.js +9 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.cjs +9 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.js +9 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.js.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-named.cjs +28 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-named.cjs.map +1 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-named.js +28 -0
- package/dist/_node_modules/stringify-entities/lib/util/to-named.js.map +1 -0
- package/dist/_node_modules/trim-lines/index.cjs +42 -0
- package/dist/_node_modules/trim-lines/index.cjs.map +1 -0
- package/dist/_node_modules/trim-lines/index.js +42 -0
- package/dist/_node_modules/trim-lines/index.js.map +1 -0
- package/dist/_node_modules/trough/lib/index.cjs +87 -0
- package/dist/_node_modules/trough/lib/index.cjs.map +1 -0
- package/dist/_node_modules/trough/lib/index.js +87 -0
- package/dist/_node_modules/trough/lib/index.js.map +1 -0
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.cjs +10 -0
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.cjs.map +1 -0
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.js +11 -0
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.js.map +1 -0
- package/dist/_node_modules/unified/lib/callable-instance.cjs +31 -0
- package/dist/_node_modules/unified/lib/callable-instance.cjs.map +1 -0
- package/dist/_node_modules/unified/lib/callable-instance.js +31 -0
- package/dist/_node_modules/unified/lib/callable-instance.js.map +1 -0
- package/dist/_node_modules/unified/lib/index.cjs +637 -0
- package/dist/_node_modules/unified/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unified/lib/index.js +637 -0
- package/dist/_node_modules/unified/lib/index.js.map +1 -0
- package/dist/_node_modules/unist-util-is/lib/index.cjs +94 -0
- package/dist/_node_modules/unist-util-is/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unist-util-is/lib/index.js +94 -0
- package/dist/_node_modules/unist-util-is/lib/index.js.map +1 -0
- package/dist/_node_modules/unist-util-position/lib/index.cjs +28 -0
- package/dist/_node_modules/unist-util-position/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unist-util-position/lib/index.js +28 -0
- package/dist/_node_modules/unist-util-position/lib/index.js.map +1 -0
- package/dist/_node_modules/unist-util-remove/lib/index.cjs +39 -0
- package/dist/_node_modules/unist-util-remove/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unist-util-remove/lib/index.js +39 -0
- package/dist/_node_modules/unist-util-remove/lib/index.js.map +1 -0
- package/dist/_node_modules/unist-util-stringify-position/lib/index.cjs +28 -0
- package/dist/_node_modules/unist-util-stringify-position/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unist-util-stringify-position/lib/index.js +28 -0
- package/dist/_node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
- package/dist/_node_modules/unist-util-visit/lib/index.cjs +28 -0
- package/dist/_node_modules/unist-util-visit/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unist-util-visit/lib/index.js +29 -0
- package/dist/_node_modules/unist-util-visit/lib/index.js.map +1 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/color.cjs +7 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/color.cjs.map +1 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/color.js +7 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/index.cjs +84 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/index.cjs.map +1 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/index.js +84 -0
- package/dist/_node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
- package/dist/_node_modules/vfile/lib/index.cjs +463 -0
- package/dist/_node_modules/vfile/lib/index.cjs.map +1 -0
- package/dist/_node_modules/vfile/lib/index.js +463 -0
- package/dist/_node_modules/vfile/lib/index.js.map +1 -0
- package/dist/_node_modules/vfile/lib/minpath.browser.cjs +215 -0
- package/dist/_node_modules/vfile/lib/minpath.browser.cjs.map +1 -0
- package/dist/_node_modules/vfile/lib/minpath.browser.js +215 -0
- package/dist/_node_modules/vfile/lib/minpath.browser.js.map +1 -0
- package/dist/_node_modules/vfile/lib/minproc.browser.cjs +8 -0
- package/dist/_node_modules/vfile/lib/minproc.browser.cjs.map +1 -0
- package/dist/_node_modules/vfile/lib/minproc.browser.js +8 -0
- package/dist/_node_modules/vfile/lib/minproc.browser.js.map +1 -0
- package/dist/_node_modules/vfile/lib/minurl.browser.cjs +47 -0
- package/dist/_node_modules/vfile/lib/minurl.browser.cjs.map +1 -0
- package/dist/_node_modules/vfile/lib/minurl.browser.js +47 -0
- package/dist/_node_modules/vfile/lib/minurl.browser.js.map +1 -0
- package/dist/_node_modules/vfile/lib/minurl.shared.cjs +10 -0
- package/dist/_node_modules/vfile/lib/minurl.shared.cjs.map +1 -0
- package/dist/_node_modules/vfile/lib/minurl.shared.js +10 -0
- package/dist/_node_modules/vfile/lib/minurl.shared.js.map +1 -0
- package/dist/_node_modules/vfile-location/lib/index.cjs +50 -0
- package/dist/_node_modules/vfile-location/lib/index.cjs.map +1 -0
- package/dist/_node_modules/vfile-location/lib/index.js +50 -0
- package/dist/_node_modules/vfile-location/lib/index.js.map +1 -0
- package/dist/_node_modules/vfile-message/lib/index.cjs +139 -0
- package/dist/_node_modules/vfile-message/lib/index.cjs.map +1 -0
- package/dist/_node_modules/vfile-message/lib/index.js +139 -0
- package/dist/_node_modules/vfile-message/lib/index.js.map +1 -0
- package/dist/_node_modules/web-namespaces/index.cjs +12 -0
- package/dist/_node_modules/web-namespaces/index.cjs.map +1 -0
- package/dist/_node_modules/web-namespaces/index.js +12 -0
- package/dist/_node_modules/web-namespaces/index.js.map +1 -0
- package/dist/_node_modules/zwitch/index.cjs +23 -0
- package/dist/_node_modules/zwitch/index.cjs.map +1 -0
- package/dist/_node_modules/zwitch/index.js +23 -0
- package/dist/_node_modules/zwitch/index.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.cjs +7 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/index.cjs +9 -0
- package/dist/_virtual/index.cjs.map +1 -0
- package/dist/_virtual/index.js +9 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.ts +1 -1
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/cookie.cjs.map +1 -1
- package/dist/cookie.js.map +1 -1
- package/dist/createClient.cjs +31 -31
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.d.ts +35 -35
- package/dist/createClient.js +31 -31
- package/dist/createClient.js.map +1 -1
- package/dist/errors/ForbiddenError.cjs.map +1 -1
- package/dist/errors/ForbiddenError.js.map +1 -1
- package/dist/errors/NotFoundError.cjs.map +1 -1
- package/dist/errors/NotFoundError.js.map +1 -1
- package/dist/errors/ParsingError.cjs.map +1 -1
- package/dist/errors/ParsingError.js.map +1 -1
- package/dist/errors/PreviewTokenExpired.cjs.map +1 -1
- package/dist/errors/PreviewTokenExpired.js.map +1 -1
- package/dist/errors/PrismicError.cjs.map +1 -1
- package/dist/errors/PrismicError.js.map +1 -1
- package/dist/errors/PrismicRichTextSerializerError.cjs.map +1 -1
- package/dist/errors/PrismicRichTextSerializerError.js.map +1 -1
- package/dist/errors/RefExpiredError.cjs.map +1 -1
- package/dist/errors/RefExpiredError.js.map +1 -1
- package/dist/errors/RefNotFoundError.cjs.map +1 -1
- package/dist/errors/RefNotFoundError.js.map +1 -1
- package/dist/errors/RepositoryNotFoundError.cjs.map +1 -1
- package/dist/errors/RepositoryNotFoundError.js.map +1 -1
- package/dist/filter.cjs.map +1 -1
- package/dist/filter.js.map +1 -1
- package/dist/getGraphQLEndpoint.cjs.map +1 -1
- package/dist/getGraphQLEndpoint.js.map +1 -1
- package/dist/getRepositoryEndpoint.cjs.map +1 -1
- package/dist/getRepositoryEndpoint.js.map +1 -1
- package/dist/getRepositoryName.cjs.map +1 -1
- package/dist/getRepositoryName.js.map +1 -1
- package/dist/getToolbarSrc.cjs.map +1 -1
- package/dist/getToolbarSrc.js.map +1 -1
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.ts +2 -2
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +2 -2
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +2 -2
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +2 -2
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.ts +2 -4
- package/dist/helpers/asLink.js.map +1 -1
- package/dist/helpers/asLinkAttrs.cjs.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +2 -2
- package/dist/helpers/asLinkAttrs.js.map +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.ts +1 -1
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/documentToLinkField.cjs.map +1 -1
- package/dist/helpers/documentToLinkField.js.map +1 -1
- package/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/helpers/isFilled.js.map +1 -1
- package/dist/helpers/mapSliceZone.cjs.map +1 -1
- package/dist/helpers/mapSliceZone.d.ts +1 -1
- package/dist/helpers/mapSliceZone.js.map +1 -1
- package/dist/helpers/unstable_htmlAsRichText.cjs +3 -3
- package/dist/helpers/unstable_htmlAsRichText.cjs.map +1 -1
- package/dist/helpers/unstable_htmlAsRichText.d.ts +4 -4
- package/dist/helpers/unstable_htmlAsRichText.js +2 -2
- package/dist/helpers/unstable_htmlAsRichText.js.map +1 -1
- package/dist/helpers/unstable_markdownAsRichText.cjs +4 -4
- package/dist/helpers/unstable_markdownAsRichText.cjs.map +1 -1
- package/dist/helpers/unstable_markdownAsRichText.d.ts +2 -2
- package/dist/helpers/unstable_markdownAsRichText.js +3 -3
- package/dist/helpers/unstable_markdownAsRichText.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/isRepositoryEndpoint.cjs.map +1 -1
- package/dist/isRepositoryEndpoint.js.map +1 -1
- package/dist/isRepositoryName.cjs.map +1 -1
- package/dist/isRepositoryName.js.map +1 -1
- package/dist/lib/RichTextFieldBuilder.cjs.map +1 -1
- package/dist/lib/RichTextFieldBuilder.d.ts +1 -1
- package/dist/lib/RichTextFieldBuilder.js.map +1 -1
- package/dist/lib/appendFilters.cjs.map +1 -1
- package/dist/lib/appendFilters.js.map +1 -1
- package/dist/lib/castArray.cjs.map +1 -1
- package/dist/lib/castArray.js.map +1 -1
- package/dist/lib/castThunk.cjs.map +1 -1
- package/dist/lib/castThunk.js.map +1 -1
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.d.ts +1 -1
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/lib/escapeHTML.cjs.map +1 -1
- package/dist/lib/escapeHTML.js.map +1 -1
- package/dist/lib/everyTagFilter.cjs.map +1 -1
- package/dist/lib/everyTagFilter.js.map +1 -1
- package/dist/lib/filterRichTextField.cjs.map +1 -1
- package/dist/lib/filterRichTextField.d.ts +3 -3
- package/dist/lib/filterRichTextField.js.map +1 -1
- package/dist/lib/findMasterRef.cjs.map +1 -1
- package/dist/lib/findMasterRef.d.ts +1 -1
- package/dist/lib/findMasterRef.js.map +1 -1
- package/dist/lib/findRef.cjs.map +1 -1
- package/dist/lib/findRef.d.ts +1 -1
- package/dist/lib/findRef.js.map +1 -1
- package/dist/lib/findRefByID.cjs.map +1 -1
- package/dist/lib/findRefByID.d.ts +1 -1
- package/dist/lib/findRefByID.js.map +1 -1
- package/dist/lib/findRefByLabel.cjs.map +1 -1
- package/dist/lib/findRefByLabel.d.ts +1 -1
- package/dist/lib/findRefByLabel.js.map +1 -1
- package/dist/lib/getPreviewCookie.cjs.map +1 -1
- package/dist/lib/getPreviewCookie.js.map +1 -1
- package/dist/lib/hastSerializerHelpers.cjs +2 -2
- package/dist/lib/hastSerializerHelpers.cjs.map +1 -1
- package/dist/lib/hastSerializerHelpers.d.ts +3 -3
- package/dist/lib/hastSerializerHelpers.js +1 -1
- package/dist/lib/hastSerializerHelpers.js.map +1 -1
- package/dist/lib/hastToRichText.cjs +6 -7
- package/dist/lib/hastToRichText.cjs.map +1 -1
- package/dist/lib/hastToRichText.d.ts +4 -4
- package/dist/lib/hastToRichText.js +3 -4
- package/dist/lib/hastToRichText.js.map +1 -1
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js.map +1 -1
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
- package/dist/lib/minifyGraphQLQuery.js.map +1 -1
- package/dist/lib/rehypeRichText.cjs +13 -12
- package/dist/lib/rehypeRichText.cjs.map +1 -1
- package/dist/lib/rehypeRichText.d.ts +5 -5
- package/dist/lib/rehypeRichText.js +5 -4
- package/dist/lib/rehypeRichText.js.map +1 -1
- package/dist/lib/serializerHelpers.cjs.map +1 -1
- package/dist/lib/serializerHelpers.d.ts +2 -2
- package/dist/lib/serializerHelpers.js.map +1 -1
- package/dist/lib/someTagsFilter.cjs.map +1 -1
- package/dist/lib/someTagsFilter.js.map +1 -1
- package/dist/lib/typeFilter.cjs.map +1 -1
- package/dist/lib/typeFilter.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/richtext/asText.cjs.map +1 -1
- package/dist/richtext/asText.d.ts +1 -1
- package/dist/richtext/asText.js.map +1 -1
- package/dist/richtext/asTree.cjs.map +1 -1
- package/dist/richtext/asTree.d.ts +2 -2
- package/dist/richtext/asTree.js.map +1 -1
- package/dist/richtext/composeSerializers.cjs.map +1 -1
- package/dist/richtext/composeSerializers.d.ts +1 -1
- package/dist/richtext/composeSerializers.js.map +1 -1
- package/dist/richtext/serialize.cjs.map +1 -1
- package/dist/richtext/serialize.d.ts +1 -1
- package/dist/richtext/serialize.js.map +1 -1
- package/dist/richtext/types.cjs.map +1 -1
- package/dist/richtext/types.d.ts +1 -1
- package/dist/richtext/types.js.map +1 -1
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
- package/dist/richtext/wrapMapSerializer.d.ts +1 -1
- package/dist/richtext/wrapMapSerializer.js.map +1 -1
- package/dist/types/api/query.d.ts +1 -1
- package/dist/types/api/release.d.ts +1 -1
- package/dist/types/api/repository.d.ts +1 -1
- package/dist/types/model/customType.d.ts +1 -1
- package/dist/types/model/link.cjs.map +1 -1
- package/dist/types/model/link.js.map +1 -1
- package/dist/types/model/slice.cjs.map +1 -1
- package/dist/types/model/slice.js.map +1 -1
- package/dist/types/model/sliceZone.cjs.map +1 -1
- package/dist/types/model/sliceZone.js.map +1 -1
- package/dist/types/model/title.d.ts +1 -1
- package/dist/types/model/types.cjs.map +1 -1
- package/dist/types/model/types.js.map +1 -1
- package/dist/types/value/document.d.ts +4 -4
- package/dist/types/value/embed.cjs.map +1 -1
- package/dist/types/value/embed.js.map +1 -1
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.js.map +1 -1
- package/dist/types/webhook/apiUpdate.d.ts +1 -1
- package/dist/types/webhook/testTrigger.d.ts +1 -1
- package/dist/types/webhook/types.cjs.map +1 -1
- package/dist/types/webhook/types.d.ts +2 -2
- package/dist/types/webhook/types.js.map +1 -1
- package/package.json +15 -13
- package/src/buildQueryURL.ts +51 -51
- package/src/cookie.ts +1 -1
- package/src/createClient.ts +293 -293
- package/src/errors/ForbiddenError.ts +6 -6
- package/src/errors/NotFoundError.ts +1 -1
- package/src/errors/ParsingError.ts +8 -8
- package/src/errors/PreviewTokenExpired.ts +4 -4
- package/src/errors/PrismicError.ts +5 -5
- package/src/errors/PrismicRichTextSerializerError.ts +1 -1
- package/src/errors/RefExpiredError.ts +4 -4
- package/src/errors/RefNotFoundError.ts +4 -4
- package/src/errors/RepositoryNotFoundError.ts +1 -1
- package/src/filter.ts +22 -22
- package/src/getGraphQLEndpoint.ts +5 -5
- package/src/getRepositoryEndpoint.ts +5 -5
- package/src/getRepositoryName.ts +4 -4
- package/src/getToolbarSrc.ts +5 -5
- package/src/helpers/asDate.ts +7 -7
- package/src/helpers/asHTML.ts +54 -56
- package/src/helpers/asImagePixelDensitySrcSet.ts +14 -17
- package/src/helpers/asImageSrc.ts +9 -8
- package/src/helpers/asImageWidthSrcSet.ts +19 -22
- package/src/helpers/asLink.ts +26 -27
- package/src/helpers/asLinkAttrs.ts +30 -29
- package/src/helpers/asText.ts +15 -15
- package/src/helpers/documentToLinkField.ts +6 -6
- package/src/helpers/isFilled.ts +53 -53
- package/src/helpers/mapSliceZone.ts +34 -34
- package/src/helpers/unstable_htmlAsRichText.ts +23 -22
- package/src/helpers/unstable_markdownAsRichText.ts +14 -13
- package/src/index.ts +119 -119
- package/src/isRepositoryEndpoint.ts +4 -4
- package/src/isRepositoryName.ts +2 -2
- package/src/lib/RichTextFieldBuilder.ts +36 -41
- package/src/lib/appendFilters.ts +4 -4
- package/src/lib/castArray.ts +2 -2
- package/src/lib/castThunk.ts +2 -2
- package/src/lib/devMsg.ts +4 -4
- package/src/lib/escapeHTML.ts +24 -24
- package/src/lib/everyTagFilter.ts +4 -4
- package/src/lib/filterRichTextField.ts +31 -31
- package/src/lib/findMasterRef.ts +4 -4
- package/src/lib/findRef.ts +6 -6
- package/src/lib/findRefByID.ts +4 -4
- package/src/lib/findRefByLabel.ts +4 -4
- package/src/lib/getPreviewCookie.ts +11 -11
- package/src/lib/hastSerializerHelpers.ts +41 -37
- package/src/lib/hastToRichText.ts +74 -73
- package/src/lib/isInternalURL.ts +4 -4
- package/src/lib/minifyGraphQLQuery.ts +2 -2
- package/src/lib/rehypeRichText.ts +42 -41
- package/src/lib/serializerHelpers.ts +53 -54
- package/src/lib/someTagsFilter.ts +4 -4
- package/src/lib/typeFilter.ts +3 -3
- package/src/richtext/asText.ts +5 -5
- package/src/richtext/asTree.ts +53 -53
- package/src/richtext/composeSerializers.ts +6 -6
- package/src/richtext/index.ts +7 -7
- package/src/richtext/serialize.ts +11 -11
- package/src/richtext/types.ts +38 -38
- package/src/richtext/wrapMapSerializer.ts +6 -9
- package/src/types/api/query.ts +9 -9
- package/src/types/api/ref.ts +5 -5
- package/src/types/api/release.ts +2 -2
- package/src/types/api/repository.ts +24 -24
- package/src/types/api/tags.ts +1 -1
- package/src/types/model/boolean.ts +7 -7
- package/src/types/model/color.ts +5 -5
- package/src/types/model/contentRelationship.ts +9 -9
- package/src/types/model/customType.ts +9 -9
- package/src/types/model/date.ts +6 -6
- package/src/types/model/embed.ts +5 -5
- package/src/types/model/geoPoint.ts +4 -4
- package/src/types/model/group.ts +6 -6
- package/src/types/model/image.ts +9 -9
- package/src/types/model/integration.ts +6 -6
- package/src/types/model/keyText.ts +5 -5
- package/src/types/model/link.ts +8 -8
- package/src/types/model/linkToMedia.ts +7 -7
- package/src/types/model/number.ts +7 -7
- package/src/types/model/range.ts +8 -8
- package/src/types/model/richText.ts +16 -16
- package/src/types/model/select.ts +7 -7
- package/src/types/model/separator.ts +4 -4
- package/src/types/model/sharedSlice.ts +7 -7
- package/src/types/model/sharedSliceVariation.ts +9 -9
- package/src/types/model/slice.ts +12 -12
- package/src/types/model/sliceZone.ts +11 -11
- package/src/types/model/timestamp.ts +6 -6
- package/src/types/model/title.ts +2 -2
- package/src/types/model/types.ts +26 -26
- package/src/types/model/uid.ts +5 -5
- package/src/types/value/boolean.ts +1 -1
- package/src/types/value/color.ts +2 -2
- package/src/types/value/contentRelationship.ts +15 -15
- package/src/types/value/date.ts +2 -2
- package/src/types/value/document.ts +23 -23
- package/src/types/value/embed.ts +33 -33
- package/src/types/value/geoPoint.ts +4 -4
- package/src/types/value/group.ts +3 -3
- package/src/types/value/image.ts +21 -21
- package/src/types/value/integration.ts +2 -2
- package/src/types/value/keyText.ts +2 -2
- package/src/types/value/link.ts +12 -12
- package/src/types/value/linkToMedia.ts +11 -11
- package/src/types/value/number.ts +2 -2
- package/src/types/value/richText.ts +58 -58
- package/src/types/value/select.ts +2 -2
- package/src/types/value/sharedSlice.ts +5 -5
- package/src/types/value/sharedSliceVariation.ts +5 -5
- package/src/types/value/slice.ts +6 -6
- package/src/types/value/sliceZone.ts +4 -4
- package/src/types/value/timestamp.ts +3 -3
- package/src/types/value/title.ts +4 -4
- package/src/types/value/types.ts +22 -22
- package/src/types/webhook/apiUpdate.ts +18 -18
- package/src/types/webhook/testTrigger.ts +2 -2
- package/src/types/webhook/types.ts +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehypeRichText.cjs","sources":["../../../src/lib/rehypeRichText.ts"],"sourcesContent":["import { Element, Root } from \"hast\"
|
|
1
|
+
{"version":3,"file":"rehypeRichText.cjs","sources":["../../../src/lib/rehypeRichText.ts"],"sourcesContent":["import type { Element, Root } from \"hast\"\nimport { select, selectAll } from \"hast-util-select\"\nimport rehypeMinifyWhitespace from \"rehype-minify-whitespace\"\nimport type { Plugin, Processor } from \"unified\"\nimport { remove } from \"unist-util-remove\"\nimport { SKIP, visit } from \"unist-util-visit\"\nimport type { VFile } from \"vfile\"\n\nimport type { CustomTypeModelRichTextField } from \"../types/model/richText\"\nimport type { RichTextField } from \"../types/value/richText\"\n\nimport { filterRichTextField } from \"./filterRichTextField\"\nimport type { HASTToRichTextConfig } from \"./hastToRichText\"\nimport { hastToRichText } from \"./hastToRichText\"\n\n/**\n * Configuration options for {@link rehypeRichText}.\n */\nexport type RehypeRichTextConfig = {\n\t/**\n\t * A CSS selector that targets the section of the document to convert to rich\n\t * text.\n\t *\n\t * @example `div.post`\n\t *\n\t * @defaultValue `\":root\"` - The top-level element of the document.\n\t */\n\tcontainer?: string\n\n\t/**\n\t * A list of CSS selectors to exclude matching nodes from the document to\n\t * process.\n\t *\n\t * @example `[\".hidden\", \"aside\"]`\n\t *\n\t * @defaultValue `[]` - No nodes are excluded.\n\t */\n\texclude?: string[]\n\n\t/**\n\t * A list of CSS selectors to include only matching nodes from the document to\n\t * process.\n\t *\n\t * @example `[\"p\", \"img\"]`\n\t *\n\t * @defaultValue `[]` - All nodes are included.\n\t */\n\tinclude?: string[]\n\n\t/**\n\t * A rich text or title field model definition. When provided the serializer\n\t * will filter out any node types not allowed by the model.\n\t *\n\t * @defaultValue `undefined` - No filtering is applied.\n\t */\n\tmodel?: CustomTypeModelRichTextField\n} & HASTToRichTextConfig\n\n/**\n * A unified plugin that compiles a hast tree to a Prismic rich text field.\n *\n * @param config - Configuration options for the rehype rich text processor.\n */\n// unified requires the function to be typed directly with the\n// `Plugin` type to properly infer return types on processors.\nexport const rehypeRichText: Plugin<\n\t[config?: RehypeRichTextConfig],\n\tRoot,\n\tRichTextField\n> = function rehypeRichText(config) {\n\t// This is a bit dirty, but it seems like that's how rehype intends\n\t// it to be due to JSDocs limitations(?), see:\n\t// https://github.com/rehypejs/rehype/blob/f6912ac680704f1ef4b558ac57cbf0dd62ed0892/packages/rehype-stringify/lib/index.js#L18-L20\n\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\tconst self = this as unknown as Processor<\n\t\tundefined,\n\t\tundefined,\n\t\tundefined,\n\t\tRoot,\n\t\tRichTextField\n\t>\n\n\t// We need to exclude nodes _before_ we minify the tree as excluding\n\t// nodes could end up in more whitespaces to trim.\n\tself.use(() => {\n\t\treturn (tree: Root) => {\n\t\t\t// Extract container node if any is specified.\n\t\t\tif (config?.container) {\n\t\t\t\tconst element = select(config.container, tree)\n\n\t\t\t\tif (!element) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No container matching \\`${config?.container}\\` could be found in the input AST.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// We cannot reassign the tree itself, so we instead replace\n\t\t\t\t// its children with the found element.\n\t\t\t\ttree.children = [element]\n\t\t\t}\n\n\t\t\t// Remove excluded nodes if any are specified\n\t\t\tif (config?.exclude) {\n\t\t\t\t// We join selector to only run one query\n\t\t\t\tconst nodesToExclude = selectAll(config.exclude.join(\", \"), tree)\n\n\t\t\t\tremove(tree, (node) => nodesToExclude.includes(node as Element))\n\t\t\t}\n\n\t\t\t// Include only nodes to include\n\t\t\tif (config?.include) {\n\t\t\t\tconst nodesToInclude: Element[] = []\n\n\t\t\t\t// We join selector to only run one query\n\t\t\t\tconst selector = config.include.join(\", \")\n\t\t\t\tconst rawNodesToInclude = selectAll(selector, tree)\n\n\t\t\t\t// We walk the tree to exclude matching nodes that are children of other matching nodes.\n\t\t\t\tvisit(tree, (node) => {\n\t\t\t\t\tif (rawNodesToInclude.includes(node as Element)) {\n\t\t\t\t\t\tnodesToInclude.push(node as Element)\n\n\t\t\t\t\t\t// Stop traversing this part of the tree since we found its matching parent node.\n\t\t\t\t\t\treturn SKIP\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\t// We cannot reassign the tree itself, so we instead replace\n\t\t\t\t// its children with the found element.\n\t\t\t\ttree.children = nodesToInclude\n\t\t\t}\n\n\t\t\t// Mark nodes matching CSS selectors\n\t\t\tif (config?.serializer) {\n\t\t\t\tfor (const key in config.serializer) {\n\t\t\t\t\t// HTML tag names are single word, lowercase strings, a-z and 1-6 (headings).\n\t\t\t\t\t// Here we want to match anything that's not a valid HTML tag name and treat\n\t\t\t\t\t// it as a CSS selector. See: https://regex101.com/r/LILLWH/1\n\t\t\t\t\tif (!/^[a-z]+[1-6]?$/.test(key)) {\n\t\t\t\t\t\tconst matches = selectAll(key, tree)\n\n\t\t\t\t\t\tfor (let i = 0; i < matches.length; i++) {\n\t\t\t\t\t\t\tmatches[i].matchesSerializer = key\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\n\t// `rehypeRichText` _depends_ on `rehypeMinifyWhitespace`, that's why it's\n\t// registered within the plugin rather than on the processor directly.\n\tself.use(rehypeMinifyWhitespace)\n\n\tself.compiler = compiler\n\n\tfunction compiler(tree: Root, file: VFile): RichTextField {\n\t\tconst richTextField = hastToRichText(tree, file, config)\n\n\t\tif (config?.model) {\n\t\t\treturn filterRichTextField(richTextField, config.model)\n\t\t}\n\n\t\treturn richTextField\n\t}\n}\n\ndeclare module \"unified\" {\n\t// Register unified processor the result type.\n\tinterface CompileResultMap {\n\t\tRichTextField: RichTextField\n\t}\n}\n\ndeclare module \"hast\" {\n\t// Extend hast node with a rich text value.\n\tinterface Element {\n\t\t/**\n\t\t * A serializer this node matches to. Nodes are marked with this property\n\t\t * when they match a CSS selector from the serializer map.\n\t\t */\n\t\tmatchesSerializer?: string\n\t}\n}\n"],"names":["rehypeRichText","select","selectAll","remove","visit","SKIP","rehypeMinifyWhitespace","hastToRichText","filterRichTextField"],"mappings":";;;;;;;;;AAiEa,MAAA,iBAIT,SAASA,gBAAe,QAAM;AAKjC,QAAM,OAAO;AAUb,OAAK,IAAI,MAAK;AACb,WAAO,CAAC,SAAc;AAErB,UAAI,iCAAQ,WAAW;AACtB,cAAM,UAAUC,MAAA,OAAO,OAAO,WAAW,IAAI;AAE7C,YAAI,CAAC,SAAS;AACb,gBAAM,IAAI,MACT,2BAA2B,iCAAQ,SAAS,qCAAqC;AAAA,QAEnF;AAIK,aAAA,WAAW,CAAC,OAAO;AAAA,MACzB;AAGA,UAAI,iCAAQ,SAAS;AAEpB,cAAM,iBAAiBC,MAAU,UAAA,OAAO,QAAQ,KAAK,IAAI,GAAG,IAAI;AAEhEC,gBAAA,OAAO,MAAM,CAAC,SAAS,eAAe,SAAS,IAAe,CAAC;AAAA,MAChE;AAGA,UAAI,iCAAQ,SAAS;AACpB,cAAM,iBAA4B,CAAA;AAGlC,cAAM,WAAW,OAAO,QAAQ,KAAK,IAAI;AACnC,cAAA,oBAAoBD,MAAAA,UAAU,UAAU,IAAI;AAG5CE,sBAAA,MAAM,CAAC,SAAQ;AAChB,cAAA,kBAAkB,SAAS,IAAe,GAAG;AAChD,2BAAe,KAAK,IAAe;AAG5B,mBAAAC;UACR;AAAA,QAAA,CACA;AAID,aAAK,WAAW;AAAA,MACjB;AAGA,UAAI,iCAAQ,YAAY;AACZ,mBAAA,OAAO,OAAO,YAAY;AAIpC,cAAI,CAAC,iBAAiB,KAAK,GAAG,GAAG;AAC1B,kBAAA,UAAUH,MAAAA,UAAU,KAAK,IAAI;AAEnC,qBAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AAChC,sBAAA,CAAC,EAAE,oBAAoB;AAAA,YAChC;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IAAA;AAAA,EACD,CACA;AAID,OAAK,IAAII,OAAsB;AAE/B,OAAK,WAAW;AAEP,WAAA,SAAS,MAAY,MAAW;AACxC,UAAM,gBAAgBC,eAAA,eAAe,MAAM,MAAM,MAAM;AAEvD,QAAI,iCAAQ,OAAO;AACX,aAAAC,wCAAoB,eAAe,OAAO,KAAK;AAAA,IACvD;AAEO,WAAA;AAAA,EACR;AACD;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Root } from "hast";
|
|
2
|
-
import { Plugin } from "unified";
|
|
3
|
-
import { CustomTypeModelRichTextField } from "../types/model/richText";
|
|
4
|
-
import { RichTextField } from "../types/value/richText";
|
|
5
|
-
import { HASTToRichTextConfig } from "./hastToRichText";
|
|
1
|
+
import type { Root } from "hast";
|
|
2
|
+
import type { Plugin } from "unified";
|
|
3
|
+
import type { CustomTypeModelRichTextField } from "../types/model/richText";
|
|
4
|
+
import type { RichTextField } from "../types/value/richText";
|
|
5
|
+
import type { HASTToRichTextConfig } from "./hastToRichText";
|
|
6
6
|
/**
|
|
7
7
|
* Configuration options for {@link rehypeRichText}.
|
|
8
8
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { select, selectAll } from "hast-util-select";
|
|
2
|
-
import rehypeMinifyWhitespace from "rehype-minify-whitespace";
|
|
3
|
-
import { remove } from "unist-util-remove";
|
|
4
|
-
import { visit, SKIP } from "unist-util-visit";
|
|
5
1
|
import { filterRichTextField } from "./filterRichTextField.js";
|
|
6
2
|
import { hastToRichText } from "./hastToRichText.js";
|
|
3
|
+
import { select, selectAll } from './../_node_modules/hast-util-select/lib/index.js';
|
|
4
|
+
import { remove } from './../_node_modules/unist-util-remove/lib/index.js';
|
|
5
|
+
import { visit } from './../_node_modules/unist-util-visit/lib/index.js';
|
|
6
|
+
import rehypeMinifyWhitespace from './../_node_modules/rehype-minify-whitespace/lib/index.js';
|
|
7
|
+
import { SKIP } from './../_node_modules/unist-util-visit-parents/lib/index.js';
|
|
7
8
|
const rehypeRichText = function rehypeRichText2(config) {
|
|
8
9
|
const self = this;
|
|
9
10
|
self.use(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehypeRichText.js","sources":["../../../src/lib/rehypeRichText.ts"],"sourcesContent":["import { Element, Root } from \"hast\"
|
|
1
|
+
{"version":3,"file":"rehypeRichText.js","sources":["../../../src/lib/rehypeRichText.ts"],"sourcesContent":["import type { Element, Root } from \"hast\"\nimport { select, selectAll } from \"hast-util-select\"\nimport rehypeMinifyWhitespace from \"rehype-minify-whitespace\"\nimport type { Plugin, Processor } from \"unified\"\nimport { remove } from \"unist-util-remove\"\nimport { SKIP, visit } from \"unist-util-visit\"\nimport type { VFile } from \"vfile\"\n\nimport type { CustomTypeModelRichTextField } from \"../types/model/richText\"\nimport type { RichTextField } from \"../types/value/richText\"\n\nimport { filterRichTextField } from \"./filterRichTextField\"\nimport type { HASTToRichTextConfig } from \"./hastToRichText\"\nimport { hastToRichText } from \"./hastToRichText\"\n\n/**\n * Configuration options for {@link rehypeRichText}.\n */\nexport type RehypeRichTextConfig = {\n\t/**\n\t * A CSS selector that targets the section of the document to convert to rich\n\t * text.\n\t *\n\t * @example `div.post`\n\t *\n\t * @defaultValue `\":root\"` - The top-level element of the document.\n\t */\n\tcontainer?: string\n\n\t/**\n\t * A list of CSS selectors to exclude matching nodes from the document to\n\t * process.\n\t *\n\t * @example `[\".hidden\", \"aside\"]`\n\t *\n\t * @defaultValue `[]` - No nodes are excluded.\n\t */\n\texclude?: string[]\n\n\t/**\n\t * A list of CSS selectors to include only matching nodes from the document to\n\t * process.\n\t *\n\t * @example `[\"p\", \"img\"]`\n\t *\n\t * @defaultValue `[]` - All nodes are included.\n\t */\n\tinclude?: string[]\n\n\t/**\n\t * A rich text or title field model definition. When provided the serializer\n\t * will filter out any node types not allowed by the model.\n\t *\n\t * @defaultValue `undefined` - No filtering is applied.\n\t */\n\tmodel?: CustomTypeModelRichTextField\n} & HASTToRichTextConfig\n\n/**\n * A unified plugin that compiles a hast tree to a Prismic rich text field.\n *\n * @param config - Configuration options for the rehype rich text processor.\n */\n// unified requires the function to be typed directly with the\n// `Plugin` type to properly infer return types on processors.\nexport const rehypeRichText: Plugin<\n\t[config?: RehypeRichTextConfig],\n\tRoot,\n\tRichTextField\n> = function rehypeRichText(config) {\n\t// This is a bit dirty, but it seems like that's how rehype intends\n\t// it to be due to JSDocs limitations(?), see:\n\t// https://github.com/rehypejs/rehype/blob/f6912ac680704f1ef4b558ac57cbf0dd62ed0892/packages/rehype-stringify/lib/index.js#L18-L20\n\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\tconst self = this as unknown as Processor<\n\t\tundefined,\n\t\tundefined,\n\t\tundefined,\n\t\tRoot,\n\t\tRichTextField\n\t>\n\n\t// We need to exclude nodes _before_ we minify the tree as excluding\n\t// nodes could end up in more whitespaces to trim.\n\tself.use(() => {\n\t\treturn (tree: Root) => {\n\t\t\t// Extract container node if any is specified.\n\t\t\tif (config?.container) {\n\t\t\t\tconst element = select(config.container, tree)\n\n\t\t\t\tif (!element) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No container matching \\`${config?.container}\\` could be found in the input AST.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// We cannot reassign the tree itself, so we instead replace\n\t\t\t\t// its children with the found element.\n\t\t\t\ttree.children = [element]\n\t\t\t}\n\n\t\t\t// Remove excluded nodes if any are specified\n\t\t\tif (config?.exclude) {\n\t\t\t\t// We join selector to only run one query\n\t\t\t\tconst nodesToExclude = selectAll(config.exclude.join(\", \"), tree)\n\n\t\t\t\tremove(tree, (node) => nodesToExclude.includes(node as Element))\n\t\t\t}\n\n\t\t\t// Include only nodes to include\n\t\t\tif (config?.include) {\n\t\t\t\tconst nodesToInclude: Element[] = []\n\n\t\t\t\t// We join selector to only run one query\n\t\t\t\tconst selector = config.include.join(\", \")\n\t\t\t\tconst rawNodesToInclude = selectAll(selector, tree)\n\n\t\t\t\t// We walk the tree to exclude matching nodes that are children of other matching nodes.\n\t\t\t\tvisit(tree, (node) => {\n\t\t\t\t\tif (rawNodesToInclude.includes(node as Element)) {\n\t\t\t\t\t\tnodesToInclude.push(node as Element)\n\n\t\t\t\t\t\t// Stop traversing this part of the tree since we found its matching parent node.\n\t\t\t\t\t\treturn SKIP\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\t// We cannot reassign the tree itself, so we instead replace\n\t\t\t\t// its children with the found element.\n\t\t\t\ttree.children = nodesToInclude\n\t\t\t}\n\n\t\t\t// Mark nodes matching CSS selectors\n\t\t\tif (config?.serializer) {\n\t\t\t\tfor (const key in config.serializer) {\n\t\t\t\t\t// HTML tag names are single word, lowercase strings, a-z and 1-6 (headings).\n\t\t\t\t\t// Here we want to match anything that's not a valid HTML tag name and treat\n\t\t\t\t\t// it as a CSS selector. See: https://regex101.com/r/LILLWH/1\n\t\t\t\t\tif (!/^[a-z]+[1-6]?$/.test(key)) {\n\t\t\t\t\t\tconst matches = selectAll(key, tree)\n\n\t\t\t\t\t\tfor (let i = 0; i < matches.length; i++) {\n\t\t\t\t\t\t\tmatches[i].matchesSerializer = key\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\n\t// `rehypeRichText` _depends_ on `rehypeMinifyWhitespace`, that's why it's\n\t// registered within the plugin rather than on the processor directly.\n\tself.use(rehypeMinifyWhitespace)\n\n\tself.compiler = compiler\n\n\tfunction compiler(tree: Root, file: VFile): RichTextField {\n\t\tconst richTextField = hastToRichText(tree, file, config)\n\n\t\tif (config?.model) {\n\t\t\treturn filterRichTextField(richTextField, config.model)\n\t\t}\n\n\t\treturn richTextField\n\t}\n}\n\ndeclare module \"unified\" {\n\t// Register unified processor the result type.\n\tinterface CompileResultMap {\n\t\tRichTextField: RichTextField\n\t}\n}\n\ndeclare module \"hast\" {\n\t// Extend hast node with a rich text value.\n\tinterface Element {\n\t\t/**\n\t\t * A serializer this node matches to. Nodes are marked with this property\n\t\t * when they match a CSS selector from the serializer map.\n\t\t */\n\t\tmatchesSerializer?: string\n\t}\n}\n"],"names":["rehypeRichText"],"mappings":";;;;;;;AAiEa,MAAA,iBAIT,SAASA,gBAAe,QAAM;AAKjC,QAAM,OAAO;AAUb,OAAK,IAAI,MAAK;AACb,WAAO,CAAC,SAAc;AAErB,UAAI,iCAAQ,WAAW;AACtB,cAAM,UAAU,OAAO,OAAO,WAAW,IAAI;AAE7C,YAAI,CAAC,SAAS;AACb,gBAAM,IAAI,MACT,2BAA2B,iCAAQ,SAAS,qCAAqC;AAAA,QAEnF;AAIK,aAAA,WAAW,CAAC,OAAO;AAAA,MACzB;AAGA,UAAI,iCAAQ,SAAS;AAEpB,cAAM,iBAAiB,UAAU,OAAO,QAAQ,KAAK,IAAI,GAAG,IAAI;AAEhE,eAAO,MAAM,CAAC,SAAS,eAAe,SAAS,IAAe,CAAC;AAAA,MAChE;AAGA,UAAI,iCAAQ,SAAS;AACpB,cAAM,iBAA4B,CAAA;AAGlC,cAAM,WAAW,OAAO,QAAQ,KAAK,IAAI;AACnC,cAAA,oBAAoB,UAAU,UAAU,IAAI;AAG5C,cAAA,MAAM,CAAC,SAAQ;AAChB,cAAA,kBAAkB,SAAS,IAAe,GAAG;AAChD,2BAAe,KAAK,IAAe;AAG5B,mBAAA;AAAA,UACR;AAAA,QAAA,CACA;AAID,aAAK,WAAW;AAAA,MACjB;AAGA,UAAI,iCAAQ,YAAY;AACZ,mBAAA,OAAO,OAAO,YAAY;AAIpC,cAAI,CAAC,iBAAiB,KAAK,GAAG,GAAG;AAC1B,kBAAA,UAAU,UAAU,KAAK,IAAI;AAEnC,qBAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AAChC,sBAAA,CAAC,EAAE,oBAAoB;AAAA,YAChC;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IAAA;AAAA,EACD,CACA;AAID,OAAK,IAAI,sBAAsB;AAE/B,OAAK,WAAW;AAEP,WAAA,SAAS,MAAY,MAAW;AACxC,UAAM,gBAAgB,eAAe,MAAM,MAAM,MAAM;AAEvD,QAAI,iCAAQ,OAAO;AACX,aAAA,oBAAoB,eAAe,OAAO,KAAK;AAAA,IACvD;AAEO,WAAA;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializerHelpers.cjs","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import type { RichTextMapSerializer } from \"../richtext/types\"
|
|
1
|
+
{"version":3,"file":"serializerHelpers.cjs","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import type { RichTextMapSerializer } from \"../richtext/types\"\nimport { LinkType } from \"../types/value/link\"\nimport type { RTAnyNode } from \"../types/value/richText\"\n\nimport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLStrictRichTextMapSerializer,\n} from \"../helpers/asHTML\"\nimport type { LinkResolverFunction } from \"../helpers/asLink\"\nimport { asLink } from \"../helpers/asLink\"\n\nimport { escapeHTML } from \"./escapeHTML\"\n\ntype Attributes = Record<string, string | boolean | null | undefined>\nconst formatAttributes = (node: RTAnyNode, attributes: Attributes): string => {\n\tconst _attributes = { ...attributes }\n\n\t// Add label to attributes\n\tif (\"data\" in node && \"label\" in node.data && node.data.label) {\n\t\t_attributes.class = _attributes.class\n\t\t\t? `${_attributes.class} ${node.data.label}`\n\t\t\t: node.data.label\n\t}\n\n\tconst result = []\n\n\tfor (const key in _attributes) {\n\t\tconst value = _attributes[key]\n\n\t\tif (value) {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tresult.push(key)\n\t\t\t} else {\n\t\t\t\tresult.push(`${key}=\"${escapeHTML(value)}\"`)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add a space at the beginning if there's any result\n\tif (result.length) {\n\t\tresult.unshift(\"\")\n\t}\n\n\treturn result.join(\" \")\n}\n\nconst getGeneralAttributes = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[keyof HTMLRichTextMapSerializer],\n): Attributes => {\n\treturn serializerOrShorthand && typeof serializerOrShorthand !== \"function\"\n\t\t? serializerOrShorthand\n\t\t: {}\n}\n\nexport const serializeStandardTag = <\n\tBlockType extends keyof RichTextMapSerializer<string>,\n>(\n\ttag: string,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[BlockType],\n): NonNullable<HTMLStrictRichTextMapSerializer[BlockType]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn (({ node, children }) => {\n\t\treturn `<${tag}${formatAttributes(\n\t\t\tnode,\n\t\t\tgeneralAttributes,\n\t\t)}>${children}</${tag}>`\n\t}) as NonNullable<HTMLStrictRichTextMapSerializer[BlockType]>\n}\n\nexport const serializePreFormatted = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"preformatted\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"preformatted\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node }) => {\n\t\treturn `<pre${formatAttributes(node, generalAttributes)}>${escapeHTML(\n\t\t\tnode.text,\n\t\t)}</pre>`\n\t}\n}\n\nexport const serializeImage = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"image\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"image\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node }) => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t\tsrc: node.url,\n\t\t\talt: node.alt,\n\t\t\tcopyright: node.copyright,\n\t\t}\n\n\t\tlet imageTag = `<img${formatAttributes(node, attributes)} />`\n\n\t\t// If the image has a link, we wrap it with an anchor tag\n\t\tif (node.linkTo) {\n\t\t\timageTag = serializeHyperlink(linkResolver)({\n\t\t\t\ttype: \"hyperlink\",\n\t\t\t\tnode: {\n\t\t\t\t\ttype: \"hyperlink\",\n\t\t\t\t\tdata: node.linkTo,\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tend: 0,\n\t\t\t\t},\n\t\t\t\ttext: \"\",\n\t\t\t\tchildren: imageTag,\n\t\t\t\tkey: \"\",\n\t\t\t})!\n\t\t}\n\n\t\treturn `<p class=\"block-img\">${imageTag}</p>`\n\t}\n}\n\nexport const serializeEmbed = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"embed\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"embed\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node }) => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t\t[\"data-oembed\"]: node.oembed.embed_url,\n\t\t\t[\"data-oembed-type\"]: node.oembed.type,\n\t\t\t[\"data-oembed-provider\"]: node.oembed.provider_name,\n\t\t}\n\n\t\treturn `<div${formatAttributes(node, attributes)}>${node.oembed.html}</div>`\n\t}\n}\n\nexport const serializeHyperlink = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"hyperlink\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"hyperlink\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node, children }): string => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t}\n\n\t\tif (node.data.link_type === LinkType.Web) {\n\t\t\tattributes.href = node.data.url\n\t\t\tattributes.target = node.data.target\n\t\t\tattributes.rel = \"noopener noreferrer\"\n\t\t} else if (node.data.link_type === LinkType.Document) {\n\t\t\tattributes.href = asLink(node.data, { linkResolver })\n\t\t} else if (node.data.link_type === LinkType.Media) {\n\t\t\tattributes.href = node.data.url\n\t\t}\n\n\t\treturn `<a${formatAttributes(node, attributes)}>${children}</a>`\n\t}\n}\n\nexport const serializeSpan = (): NonNullable<\n\tHTMLStrictRichTextMapSerializer[\"span\"]\n> => {\n\treturn ({ text }): string => {\n\t\treturn text ? escapeHTML(text).replace(/\\n/g, \"<br />\") : \"\"\n\t}\n}\n"],"names":["escapeHTML","LinkType","asLink"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RichTextMapSerializer } from "../richtext/types";
|
|
2
|
-
import { HTMLRichTextMapSerializer, HTMLStrictRichTextMapSerializer } from "../helpers/asHTML";
|
|
3
|
-
import { LinkResolverFunction } from "../helpers/asLink";
|
|
2
|
+
import type { HTMLRichTextMapSerializer, HTMLStrictRichTextMapSerializer } from "../helpers/asHTML";
|
|
3
|
+
import type { LinkResolverFunction } from "../helpers/asLink";
|
|
4
4
|
export declare const serializeStandardTag: <BlockType extends keyof RichTextMapSerializer<string>>(tag: string, serializerOrShorthand?: HTMLRichTextMapSerializer[BlockType]) => NonNullable<HTMLStrictRichTextMapSerializer[BlockType]>;
|
|
5
5
|
export declare const serializePreFormatted: (serializerOrShorthand?: HTMLRichTextMapSerializer["preformatted"]) => NonNullable<HTMLStrictRichTextMapSerializer["preformatted"]>;
|
|
6
6
|
export declare const serializeImage: (linkResolver: LinkResolverFunction<string | null | undefined> | undefined | null, serializerOrShorthand?: HTMLRichTextMapSerializer["image"]) => NonNullable<HTMLStrictRichTextMapSerializer["image"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializerHelpers.js","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import type { RichTextMapSerializer } from \"../richtext/types\"
|
|
1
|
+
{"version":3,"file":"serializerHelpers.js","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import type { RichTextMapSerializer } from \"../richtext/types\"\nimport { LinkType } from \"../types/value/link\"\nimport type { RTAnyNode } from \"../types/value/richText\"\n\nimport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLStrictRichTextMapSerializer,\n} from \"../helpers/asHTML\"\nimport type { LinkResolverFunction } from \"../helpers/asLink\"\nimport { asLink } from \"../helpers/asLink\"\n\nimport { escapeHTML } from \"./escapeHTML\"\n\ntype Attributes = Record<string, string | boolean | null | undefined>\nconst formatAttributes = (node: RTAnyNode, attributes: Attributes): string => {\n\tconst _attributes = { ...attributes }\n\n\t// Add label to attributes\n\tif (\"data\" in node && \"label\" in node.data && node.data.label) {\n\t\t_attributes.class = _attributes.class\n\t\t\t? `${_attributes.class} ${node.data.label}`\n\t\t\t: node.data.label\n\t}\n\n\tconst result = []\n\n\tfor (const key in _attributes) {\n\t\tconst value = _attributes[key]\n\n\t\tif (value) {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tresult.push(key)\n\t\t\t} else {\n\t\t\t\tresult.push(`${key}=\"${escapeHTML(value)}\"`)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add a space at the beginning if there's any result\n\tif (result.length) {\n\t\tresult.unshift(\"\")\n\t}\n\n\treturn result.join(\" \")\n}\n\nconst getGeneralAttributes = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[keyof HTMLRichTextMapSerializer],\n): Attributes => {\n\treturn serializerOrShorthand && typeof serializerOrShorthand !== \"function\"\n\t\t? serializerOrShorthand\n\t\t: {}\n}\n\nexport const serializeStandardTag = <\n\tBlockType extends keyof RichTextMapSerializer<string>,\n>(\n\ttag: string,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[BlockType],\n): NonNullable<HTMLStrictRichTextMapSerializer[BlockType]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn (({ node, children }) => {\n\t\treturn `<${tag}${formatAttributes(\n\t\t\tnode,\n\t\t\tgeneralAttributes,\n\t\t)}>${children}</${tag}>`\n\t}) as NonNullable<HTMLStrictRichTextMapSerializer[BlockType]>\n}\n\nexport const serializePreFormatted = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"preformatted\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"preformatted\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node }) => {\n\t\treturn `<pre${formatAttributes(node, generalAttributes)}>${escapeHTML(\n\t\t\tnode.text,\n\t\t)}</pre>`\n\t}\n}\n\nexport const serializeImage = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"image\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"image\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node }) => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t\tsrc: node.url,\n\t\t\talt: node.alt,\n\t\t\tcopyright: node.copyright,\n\t\t}\n\n\t\tlet imageTag = `<img${formatAttributes(node, attributes)} />`\n\n\t\t// If the image has a link, we wrap it with an anchor tag\n\t\tif (node.linkTo) {\n\t\t\timageTag = serializeHyperlink(linkResolver)({\n\t\t\t\ttype: \"hyperlink\",\n\t\t\t\tnode: {\n\t\t\t\t\ttype: \"hyperlink\",\n\t\t\t\t\tdata: node.linkTo,\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tend: 0,\n\t\t\t\t},\n\t\t\t\ttext: \"\",\n\t\t\t\tchildren: imageTag,\n\t\t\t\tkey: \"\",\n\t\t\t})!\n\t\t}\n\n\t\treturn `<p class=\"block-img\">${imageTag}</p>`\n\t}\n}\n\nexport const serializeEmbed = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"embed\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"embed\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node }) => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t\t[\"data-oembed\"]: node.oembed.embed_url,\n\t\t\t[\"data-oembed-type\"]: node.oembed.type,\n\t\t\t[\"data-oembed-provider\"]: node.oembed.provider_name,\n\t\t}\n\n\t\treturn `<div${formatAttributes(node, attributes)}>${node.oembed.html}</div>`\n\t}\n}\n\nexport const serializeHyperlink = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"hyperlink\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"hyperlink\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand)\n\n\treturn ({ node, children }): string => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t}\n\n\t\tif (node.data.link_type === LinkType.Web) {\n\t\t\tattributes.href = node.data.url\n\t\t\tattributes.target = node.data.target\n\t\t\tattributes.rel = \"noopener noreferrer\"\n\t\t} else if (node.data.link_type === LinkType.Document) {\n\t\t\tattributes.href = asLink(node.data, { linkResolver })\n\t\t} else if (node.data.link_type === LinkType.Media) {\n\t\t\tattributes.href = node.data.url\n\t\t}\n\n\t\treturn `<a${formatAttributes(node, attributes)}>${children}</a>`\n\t}\n}\n\nexport const serializeSpan = (): NonNullable<\n\tHTMLStrictRichTextMapSerializer[\"span\"]\n> => {\n\treturn ({ text }): string => {\n\t\treturn text ? escapeHTML(text).replace(/\\n/g, \"<br />\") : \"\"\n\t}\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"someTagsFilter.cjs","sources":["../../../src/lib/someTagsFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"
|
|
1
|
+
{"version":3,"file":"someTagsFilter.cjs","sources":["../../../src/lib/someTagsFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"\n\nimport { castArray } from \"./castArray\"\n\n/**\n * Creates a filter to filter content by document tags. At least one matching\n * tag is required on the document.\n *\n * @param tags - Document tags to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const someTagsFilter = (tags: string | string[]): string => {\n\treturn filter.any(\"document.tags\", castArray(tags))\n}\n"],"names":["filter","castArray"],"mappings":";;;;AAYa,MAAA,iBAAiB,CAAC,SAAmC;AACjE,SAAOA,OAAAA,OAAO,IAAI,iBAAiBC,UAAAA,UAAU,IAAI,CAAC;AACnD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"someTagsFilter.js","sources":["../../../src/lib/someTagsFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"
|
|
1
|
+
{"version":3,"file":"someTagsFilter.js","sources":["../../../src/lib/someTagsFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"\n\nimport { castArray } from \"./castArray\"\n\n/**\n * Creates a filter to filter content by document tags. At least one matching\n * tag is required on the document.\n *\n * @param tags - Document tags to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const someTagsFilter = (tags: string | string[]): string => {\n\treturn filter.any(\"document.tags\", castArray(tags))\n}\n"],"names":[],"mappings":";;AAYa,MAAA,iBAAiB,CAAC,SAAmC;AACjE,SAAO,OAAO,IAAI,iBAAiB,UAAU,IAAI,CAAC;AACnD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeFilter.cjs","sources":["../../../src/lib/typeFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"
|
|
1
|
+
{"version":3,"file":"typeFilter.cjs","sources":["../../../src/lib/typeFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"\n\n/**\n * Creates a filter to filter content by document type.\n *\n * @param documentType - The document type to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const typeFilter = (documentType: string): string => {\n\treturn filter.at(\"document.type\", documentType)\n}\n"],"names":["filter"],"mappings":";;;AASa,MAAA,aAAa,CAAC,iBAAgC;AACnD,SAAAA,cAAO,GAAG,iBAAiB,YAAY;AAC/C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeFilter.js","sources":["../../../src/lib/typeFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"
|
|
1
|
+
{"version":3,"file":"typeFilter.js","sources":["../../../src/lib/typeFilter.ts"],"sourcesContent":["import { filter } from \"../filter\"\n\n/**\n * Creates a filter to filter content by document type.\n *\n * @param documentType - The document type to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const typeFilter = (documentType: string): string => {\n\treturn filter.at(\"document.type\", documentType)\n}\n"],"names":[],"mappings":";AASa,MAAA,aAAa,CAAC,iBAAgC;AACnD,SAAA,OAAO,GAAG,iBAAiB,YAAY;AAC/C;"}
|
package/dist/package.json.cjs
CHANGED
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asText.cjs","sources":["../../../src/richtext/asText.ts"],"sourcesContent":["import { RTTextNode, RichTextField } from \"../types/value/richText\"
|
|
1
|
+
{"version":3,"file":"asText.cjs","sources":["../../../src/richtext/asText.ts"],"sourcesContent":["import type { RTTextNode, RichTextField } from \"../types/value/richText\"\n\n/**\n * Serializes a rich text or title field to a plain text string\n *\n * @param richTextField - A rich text or title field from Prismic\n * @param separator - Separator used to join each element, defaults to a space\n *\n * @returns Plain text equivalent of the provided rich text or title field\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport const asText = (\n\trichTextField: RichTextField,\n\tseparator = \" \",\n): string => {\n\tlet result = \"\"\n\n\tfor (let i = 0; i < richTextField.length; i++) {\n\t\tif (\"text\" in richTextField[i]) {\n\t\t\tresult +=\n\t\t\t\t(result ? separator : \"\") + (richTextField[i] as RTTextNode).text\n\t\t}\n\t}\n\n\treturn result\n}\n"],"names":[],"mappings":";;AAYO,MAAM,SAAS,CACrB,eACA,YAAY,QACD;AACX,MAAI,SAAS;AAEb,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;AAC1C,QAAA,UAAU,cAAc,CAAC,GAAG;AAC/B,iBACE,SAAS,YAAY,MAAO,cAAc,CAAC,EAAiB;AAAA,IAC/D;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asText.js","sources":["../../../src/richtext/asText.ts"],"sourcesContent":["import { RTTextNode, RichTextField } from \"../types/value/richText\"
|
|
1
|
+
{"version":3,"file":"asText.js","sources":["../../../src/richtext/asText.ts"],"sourcesContent":["import type { RTTextNode, RichTextField } from \"../types/value/richText\"\n\n/**\n * Serializes a rich text or title field to a plain text string\n *\n * @param richTextField - A rich text or title field from Prismic\n * @param separator - Separator used to join each element, defaults to a space\n *\n * @returns Plain text equivalent of the provided rich text or title field\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport const asText = (\n\trichTextField: RichTextField,\n\tseparator = \" \",\n): string => {\n\tlet result = \"\"\n\n\tfor (let i = 0; i < richTextField.length; i++) {\n\t\tif (\"text\" in richTextField[i]) {\n\t\t\tresult +=\n\t\t\t\t(result ? separator : \"\") + (richTextField[i] as RTTextNode).text\n\t\t}\n\t}\n\n\treturn result\n}\n"],"names":[],"mappings":"AAYO,MAAM,SAAS,CACrB,eACA,YAAY,QACD;AACX,MAAI,SAAS;AAEb,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;AAC1C,QAAA,UAAU,cAAc,CAAC,GAAG;AAC/B,iBACE,SAAS,YAAY,MAAO,cAAc,CAAC,EAAiB;AAAA,IAC/D;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asTree.cjs","sources":["../../../src/richtext/asTree.ts"],"sourcesContent":["import {\n\tRTAnyNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTListItemNode,\n\tRTNode,\n\tRTOListItemNode,\n\tRTTextNode,\n\
|
|
1
|
+
{"version":3,"file":"asTree.cjs","sources":["../../../src/richtext/asTree.ts"],"sourcesContent":["import type {\n\tRTAnyNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTListItemNode,\n\tRTNode,\n\tRTOListItemNode,\n\tRTTextNode,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\nimport type { Tree, TreeNode } from \"./types\"\n\nconst uuid = (): string => {\n\treturn (++uuid.i).toString()\n}\nuuid.i = 0\n\n/**\n * Parses a rich text or title field into a tree\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages. Most users aren't expected to this function directly.\n *\n * @param nodes - A rich text or title field from Prismic\n *\n * @returns Tree from given rich text or title field\n */\nexport const asTree = (nodes: RTNode[]): Tree => {\n\tconst preparedNodes = prepareNodes(nodes)\n\n\tconst children: TreeNode[] = []\n\tfor (let i = 0; i < preparedNodes.length; i++) {\n\t\tchildren.push(nodeToTreeNode(preparedNodes[i]))\n\t}\n\n\treturn {\n\t\tkey: uuid(),\n\t\tchildren,\n\t}\n}\n\nconst createTreeNode = (\n\tnode: RTAnyNode,\n\tchildren: TreeNode[] = [],\n): TreeNode => {\n\treturn {\n\t\tkey: uuid(),\n\t\ttype: node.type,\n\t\ttext: \"text\" in node ? node.text : undefined,\n\t\tnode,\n\t\tchildren,\n\t}\n}\n\nconst createTextTreeNode = (text: string): TreeNode => {\n\treturn createTreeNode({\n\t\ttype: RichTextNodeType.span,\n\t\ttext,\n\t\tspans: [],\n\t})\n}\n\nconst prepareNodes = (nodes: RTNode[]): RTBlockNode[] => {\n\tconst mutNodes: RTBlockNode[] = nodes.slice(0)\n\n\tfor (let i = 0; i < mutNodes.length; i++) {\n\t\tconst node = mutNodes[i]\n\n\t\tif (\n\t\t\tnode.type === RichTextNodeType.listItem ||\n\t\t\tnode.type === RichTextNodeType.oListItem\n\t\t) {\n\t\t\tconst items: (RTListItemNode | RTOListItemNode)[] = [\n\t\t\t\tnode as RTListItemNode | RTOListItemNode,\n\t\t\t]\n\n\t\t\twhile (mutNodes[i + 1] && mutNodes[i + 1].type === node.type) {\n\t\t\t\titems.push(mutNodes[i + 1] as RTListItemNode | RTOListItemNode)\n\t\t\t\tmutNodes.splice(i, 1)\n\t\t\t}\n\n\t\t\tif (node.type === RichTextNodeType.listItem) {\n\t\t\t\tmutNodes[i] = {\n\t\t\t\t\ttype: RichTextNodeType.list,\n\t\t\t\t\titems: items as RTListItemNode[],\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmutNodes[i] = {\n\t\t\t\t\ttype: RichTextNodeType.oList,\n\t\t\t\t\titems: items as RTOListItemNode[],\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn mutNodes\n}\n\nconst nodeToTreeNode = (node: RTBlockNode): TreeNode => {\n\tif (\"text\" in node) {\n\t\treturn createTreeNode(\n\t\t\tnode,\n\t\t\ttextNodeSpansToTreeNodeChildren(node.spans, node),\n\t\t)\n\t}\n\n\tif (\"items\" in node) {\n\t\tconst children: TreeNode[] = []\n\t\tfor (let i = 0; i < node.items.length; i++) {\n\t\t\tchildren.push(nodeToTreeNode(node.items[i]))\n\t\t}\n\n\t\treturn createTreeNode(node, children)\n\t}\n\n\treturn createTreeNode(node)\n}\n\nconst textNodeSpansToTreeNodeChildren = (\n\tspans: RTInlineNode[],\n\tnode: RTTextNode,\n\tparentSpan?: RTInlineNode,\n): TreeNode[] => {\n\tif (!spans.length) {\n\t\treturn [createTextTreeNode(node.text)]\n\t}\n\n\tconst mutSpans: RTInlineNode[] = spans.slice(0)\n\n\t// Sort spans using the following criteria:\n\t//\n\t// 1. By start index (ascending)\n\t// 2. If start indices are equal, by end index (descending)\n\t//\n\t// If start and end indices of more than one span are equal, use what\n\t// the API gives without modifications.\n\t//\n\t// Sorting using this algorithm ensures proper detection of child\n\t// spans.\n\tmutSpans.sort((a, b) => a.start - b.start || b.end - a.end)\n\n\tconst children: TreeNode[] = []\n\n\tfor (let i = 0; i < mutSpans.length; i++) {\n\t\tconst span = mutSpans[i]\n\t\tconst parentSpanStart = (parentSpan && parentSpan.start) || 0\n\t\tconst spanStart = span.start - parentSpanStart\n\t\tconst spanEnd = span.end - parentSpanStart\n\t\tconst text = node.text.slice(spanStart, spanEnd)\n\n\t\tconst childSpans: RTInlineNode[] = []\n\t\tfor (let j = i; j < mutSpans.length; j++) {\n\t\t\tconst siblingSpan = mutSpans[j]\n\n\t\t\tif (siblingSpan !== span) {\n\t\t\t\tif (siblingSpan.start >= span.start && siblingSpan.end <= span.end) {\n\t\t\t\t\tchildSpans.push(siblingSpan)\n\t\t\t\t\tmutSpans.splice(j, 1)\n\t\t\t\t\tj--\n\t\t\t\t} else if (\n\t\t\t\t\tsiblingSpan.start < span.end &&\n\t\t\t\t\tsiblingSpan.end > span.start\n\t\t\t\t) {\n\t\t\t\t\tchildSpans.push({\n\t\t\t\t\t\t...siblingSpan,\n\t\t\t\t\t\tend: span.end,\n\t\t\t\t\t})\n\t\t\t\t\tmutSpans[j] = {\n\t\t\t\t\t\t...siblingSpan,\n\t\t\t\t\t\tstart: span.end,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (i === 0 && spanStart > 0) {\n\t\t\tchildren.push(createTextTreeNode(node.text.slice(0, spanStart)))\n\t\t}\n\n\t\tconst spanWithText = { ...span, text }\n\t\tchildren.push(\n\t\t\tcreateTreeNode(\n\t\t\t\tspanWithText,\n\t\t\t\ttextNodeSpansToTreeNodeChildren(\n\t\t\t\t\tchildSpans,\n\t\t\t\t\t{\n\t\t\t\t\t\t...node,\n\t\t\t\t\t\ttext,\n\t\t\t\t\t},\n\t\t\t\t\tspan,\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\n\t\tif (spanEnd < node.text.length) {\n\t\t\tchildren.push(\n\t\t\t\tcreateTextTreeNode(\n\t\t\t\t\tnode.text.slice(\n\t\t\t\t\t\tspanEnd,\n\t\t\t\t\t\tmutSpans[i + 1]\n\t\t\t\t\t\t\t? mutSpans[i + 1].start - parentSpanStart\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn children\n}\n"],"names":["RichTextNodeType"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asTree.js","sources":["../../../src/richtext/asTree.ts"],"sourcesContent":["import {\n\tRTAnyNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTListItemNode,\n\tRTNode,\n\tRTOListItemNode,\n\tRTTextNode,\n\
|
|
1
|
+
{"version":3,"file":"asTree.js","sources":["../../../src/richtext/asTree.ts"],"sourcesContent":["import type {\n\tRTAnyNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTListItemNode,\n\tRTNode,\n\tRTOListItemNode,\n\tRTTextNode,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\nimport type { Tree, TreeNode } from \"./types\"\n\nconst uuid = (): string => {\n\treturn (++uuid.i).toString()\n}\nuuid.i = 0\n\n/**\n * Parses a rich text or title field into a tree\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages. Most users aren't expected to this function directly.\n *\n * @param nodes - A rich text or title field from Prismic\n *\n * @returns Tree from given rich text or title field\n */\nexport const asTree = (nodes: RTNode[]): Tree => {\n\tconst preparedNodes = prepareNodes(nodes)\n\n\tconst children: TreeNode[] = []\n\tfor (let i = 0; i < preparedNodes.length; i++) {\n\t\tchildren.push(nodeToTreeNode(preparedNodes[i]))\n\t}\n\n\treturn {\n\t\tkey: uuid(),\n\t\tchildren,\n\t}\n}\n\nconst createTreeNode = (\n\tnode: RTAnyNode,\n\tchildren: TreeNode[] = [],\n): TreeNode => {\n\treturn {\n\t\tkey: uuid(),\n\t\ttype: node.type,\n\t\ttext: \"text\" in node ? node.text : undefined,\n\t\tnode,\n\t\tchildren,\n\t}\n}\n\nconst createTextTreeNode = (text: string): TreeNode => {\n\treturn createTreeNode({\n\t\ttype: RichTextNodeType.span,\n\t\ttext,\n\t\tspans: [],\n\t})\n}\n\nconst prepareNodes = (nodes: RTNode[]): RTBlockNode[] => {\n\tconst mutNodes: RTBlockNode[] = nodes.slice(0)\n\n\tfor (let i = 0; i < mutNodes.length; i++) {\n\t\tconst node = mutNodes[i]\n\n\t\tif (\n\t\t\tnode.type === RichTextNodeType.listItem ||\n\t\t\tnode.type === RichTextNodeType.oListItem\n\t\t) {\n\t\t\tconst items: (RTListItemNode | RTOListItemNode)[] = [\n\t\t\t\tnode as RTListItemNode | RTOListItemNode,\n\t\t\t]\n\n\t\t\twhile (mutNodes[i + 1] && mutNodes[i + 1].type === node.type) {\n\t\t\t\titems.push(mutNodes[i + 1] as RTListItemNode | RTOListItemNode)\n\t\t\t\tmutNodes.splice(i, 1)\n\t\t\t}\n\n\t\t\tif (node.type === RichTextNodeType.listItem) {\n\t\t\t\tmutNodes[i] = {\n\t\t\t\t\ttype: RichTextNodeType.list,\n\t\t\t\t\titems: items as RTListItemNode[],\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmutNodes[i] = {\n\t\t\t\t\ttype: RichTextNodeType.oList,\n\t\t\t\t\titems: items as RTOListItemNode[],\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn mutNodes\n}\n\nconst nodeToTreeNode = (node: RTBlockNode): TreeNode => {\n\tif (\"text\" in node) {\n\t\treturn createTreeNode(\n\t\t\tnode,\n\t\t\ttextNodeSpansToTreeNodeChildren(node.spans, node),\n\t\t)\n\t}\n\n\tif (\"items\" in node) {\n\t\tconst children: TreeNode[] = []\n\t\tfor (let i = 0; i < node.items.length; i++) {\n\t\t\tchildren.push(nodeToTreeNode(node.items[i]))\n\t\t}\n\n\t\treturn createTreeNode(node, children)\n\t}\n\n\treturn createTreeNode(node)\n}\n\nconst textNodeSpansToTreeNodeChildren = (\n\tspans: RTInlineNode[],\n\tnode: RTTextNode,\n\tparentSpan?: RTInlineNode,\n): TreeNode[] => {\n\tif (!spans.length) {\n\t\treturn [createTextTreeNode(node.text)]\n\t}\n\n\tconst mutSpans: RTInlineNode[] = spans.slice(0)\n\n\t// Sort spans using the following criteria:\n\t//\n\t// 1. By start index (ascending)\n\t// 2. If start indices are equal, by end index (descending)\n\t//\n\t// If start and end indices of more than one span are equal, use what\n\t// the API gives without modifications.\n\t//\n\t// Sorting using this algorithm ensures proper detection of child\n\t// spans.\n\tmutSpans.sort((a, b) => a.start - b.start || b.end - a.end)\n\n\tconst children: TreeNode[] = []\n\n\tfor (let i = 0; i < mutSpans.length; i++) {\n\t\tconst span = mutSpans[i]\n\t\tconst parentSpanStart = (parentSpan && parentSpan.start) || 0\n\t\tconst spanStart = span.start - parentSpanStart\n\t\tconst spanEnd = span.end - parentSpanStart\n\t\tconst text = node.text.slice(spanStart, spanEnd)\n\n\t\tconst childSpans: RTInlineNode[] = []\n\t\tfor (let j = i; j < mutSpans.length; j++) {\n\t\t\tconst siblingSpan = mutSpans[j]\n\n\t\t\tif (siblingSpan !== span) {\n\t\t\t\tif (siblingSpan.start >= span.start && siblingSpan.end <= span.end) {\n\t\t\t\t\tchildSpans.push(siblingSpan)\n\t\t\t\t\tmutSpans.splice(j, 1)\n\t\t\t\t\tj--\n\t\t\t\t} else if (\n\t\t\t\t\tsiblingSpan.start < span.end &&\n\t\t\t\t\tsiblingSpan.end > span.start\n\t\t\t\t) {\n\t\t\t\t\tchildSpans.push({\n\t\t\t\t\t\t...siblingSpan,\n\t\t\t\t\t\tend: span.end,\n\t\t\t\t\t})\n\t\t\t\t\tmutSpans[j] = {\n\t\t\t\t\t\t...siblingSpan,\n\t\t\t\t\t\tstart: span.end,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (i === 0 && spanStart > 0) {\n\t\t\tchildren.push(createTextTreeNode(node.text.slice(0, spanStart)))\n\t\t}\n\n\t\tconst spanWithText = { ...span, text }\n\t\tchildren.push(\n\t\t\tcreateTreeNode(\n\t\t\t\tspanWithText,\n\t\t\t\ttextNodeSpansToTreeNodeChildren(\n\t\t\t\t\tchildSpans,\n\t\t\t\t\t{\n\t\t\t\t\t\t...node,\n\t\t\t\t\t\ttext,\n\t\t\t\t\t},\n\t\t\t\t\tspan,\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\n\t\tif (spanEnd < node.text.length) {\n\t\t\tchildren.push(\n\t\t\t\tcreateTextTreeNode(\n\t\t\t\t\tnode.text.slice(\n\t\t\t\t\t\tspanEnd,\n\t\t\t\t\t\tmutSpans[i + 1]\n\t\t\t\t\t\t\t? mutSpans[i + 1].start - parentSpanStart\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn children\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeSerializers.cjs","sources":["../../../src/richtext/composeSerializers.ts"],"sourcesContent":["import { RichTextFunctionSerializer } from \"./types\"
|
|
1
|
+
{"version":3,"file":"composeSerializers.cjs","sources":["../../../src/richtext/composeSerializers.ts"],"sourcesContent":["import type { RichTextFunctionSerializer } from \"./types\"\n\n/**\n * Takes an array of serializers and returns a serializer applying provided\n * serializers sequentially until a result is returned\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of serializers\n *\n * @param serializers - Serializers to compose\n *\n * @returns Composed serializer\n */\nexport const composeSerializers = <SerializerReturnType>(\n\t...serializers: (\n\t\t| RichTextFunctionSerializer<SerializerReturnType>\n\t\t| undefined\n\t)[]\n): RichTextFunctionSerializer<SerializerReturnType> => {\n\treturn (...args) => {\n\t\tfor (let i = 0; i < serializers.length; i++) {\n\t\t\tconst serializer = serializers[i]\n\n\t\t\tif (serializer) {\n\t\t\t\tconst res = serializer(...args)\n\n\t\t\t\tif (res != null) {\n\t\t\t\t\treturn res\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAgBa,MAAA,qBAAqB,IAC9B,gBAIkD;AACrD,SAAO,IAAI,SAAQ;AAClB,aAAS,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;AACtC,YAAA,aAAa,YAAY,CAAC;AAEhC,UAAI,YAAY;AACT,cAAA,MAAM,WAAW,GAAG,IAAI;AAE9B,YAAI,OAAO,MAAM;AACT,iBAAA;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EAAA;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeSerializers.js","sources":["../../../src/richtext/composeSerializers.ts"],"sourcesContent":["import { RichTextFunctionSerializer } from \"./types\"
|
|
1
|
+
{"version":3,"file":"composeSerializers.js","sources":["../../../src/richtext/composeSerializers.ts"],"sourcesContent":["import type { RichTextFunctionSerializer } from \"./types\"\n\n/**\n * Takes an array of serializers and returns a serializer applying provided\n * serializers sequentially until a result is returned\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of serializers\n *\n * @param serializers - Serializers to compose\n *\n * @returns Composed serializer\n */\nexport const composeSerializers = <SerializerReturnType>(\n\t...serializers: (\n\t\t| RichTextFunctionSerializer<SerializerReturnType>\n\t\t| undefined\n\t)[]\n): RichTextFunctionSerializer<SerializerReturnType> => {\n\treturn (...args) => {\n\t\tfor (let i = 0; i < serializers.length; i++) {\n\t\t\tconst serializer = serializers[i]\n\n\t\t\tif (serializer) {\n\t\t\t\tconst res = serializer(...args)\n\n\t\t\t\tif (res != null) {\n\t\t\t\t\treturn res\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAgBa,MAAA,qBAAqB,IAC9B,gBAIkD;AACrD,SAAO,IAAI,SAAQ;AAClB,aAAS,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;AACtC,YAAA,aAAa,YAAY,CAAC;AAEhC,UAAI,YAAY;AACT,cAAA,MAAM,WAAW,GAAG,IAAI;AAE9B,YAAI,OAAO,MAAM;AACT,iBAAA;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EAAA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.cjs","sources":["../../../src/richtext/serialize.ts"],"sourcesContent":["import type { RichTextField } from \"../types/value/richText\"
|
|
1
|
+
{"version":3,"file":"serialize.cjs","sources":["../../../src/richtext/serialize.ts"],"sourcesContent":["import type { RichTextField } from \"../types/value/richText\"\nimport type { RichTextFunctionSerializer, TreeNode } from \"./types\"\n\nimport { asTree } from \"./asTree\"\n\n/**\n * Serializes a rich text or title field with a given serializer\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of the serializer\n *\n * @param richTextField - A rich text or title field from Prismic\n * @param serializer - A function serializer to apply\n *\n * @returns An array of serialized nodes\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport const serialize = <SerializerReturnType>(\n\trichTextField: RichTextField,\n\tserializer: RichTextFunctionSerializer<SerializerReturnType>,\n): SerializerReturnType[] => {\n\treturn serializeTreeNodes<SerializerReturnType>(\n\t\tasTree(richTextField).children,\n\t\tserializer,\n\t)\n}\n\nconst serializeTreeNodes = <T>(\n\tnodes: TreeNode[],\n\tserializer: RichTextFunctionSerializer<T>,\n): T[] => {\n\tconst serializedTreeNodes: T[] = []\n\n\tfor (let i = 0; i < nodes.length; i++) {\n\t\tconst treeNode = nodes[i]\n\t\tconst serializedTreeNode = serializer(\n\t\t\ttreeNode.type,\n\t\t\ttreeNode.node,\n\t\t\ttreeNode.text,\n\t\t\tserializeTreeNodes(treeNode.children, serializer),\n\t\t\ttreeNode.key,\n\t\t)\n\n\t\tif (serializedTreeNode != null) {\n\t\t\tserializedTreeNodes.push(serializedTreeNode)\n\t\t}\n\t}\n\n\treturn serializedTreeNodes\n}\n"],"names":["asTree"],"mappings":";;;AAqBa,MAAA,YAAY,CACxB,eACA,eAC2B;AAC3B,SAAO,mBACNA,OAAAA,OAAO,aAAa,EAAE,UACtB,UAAU;AAEZ;AAEA,MAAM,qBAAqB,CAC1B,OACA,eACQ;AACR,QAAM,sBAA2B,CAAA;AAEjC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AAChC,UAAA,WAAW,MAAM,CAAC;AACxB,UAAM,qBAAqB,WAC1B,SAAS,MACT,SAAS,MACT,SAAS,MACT,mBAAmB,SAAS,UAAU,UAAU,GAChD,SAAS,GAAG;AAGb,QAAI,sBAAsB,MAAM;AAC/B,0BAAoB,KAAK,kBAAkB;AAAA,IAC5C;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sources":["../../../src/richtext/serialize.ts"],"sourcesContent":["import type { RichTextField } from \"../types/value/richText\"
|
|
1
|
+
{"version":3,"file":"serialize.js","sources":["../../../src/richtext/serialize.ts"],"sourcesContent":["import type { RichTextField } from \"../types/value/richText\"\nimport type { RichTextFunctionSerializer, TreeNode } from \"./types\"\n\nimport { asTree } from \"./asTree\"\n\n/**\n * Serializes a rich text or title field with a given serializer\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of the serializer\n *\n * @param richTextField - A rich text or title field from Prismic\n * @param serializer - A function serializer to apply\n *\n * @returns An array of serialized nodes\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport const serialize = <SerializerReturnType>(\n\trichTextField: RichTextField,\n\tserializer: RichTextFunctionSerializer<SerializerReturnType>,\n): SerializerReturnType[] => {\n\treturn serializeTreeNodes<SerializerReturnType>(\n\t\tasTree(richTextField).children,\n\t\tserializer,\n\t)\n}\n\nconst serializeTreeNodes = <T>(\n\tnodes: TreeNode[],\n\tserializer: RichTextFunctionSerializer<T>,\n): T[] => {\n\tconst serializedTreeNodes: T[] = []\n\n\tfor (let i = 0; i < nodes.length; i++) {\n\t\tconst treeNode = nodes[i]\n\t\tconst serializedTreeNode = serializer(\n\t\t\ttreeNode.type,\n\t\t\ttreeNode.node,\n\t\t\ttreeNode.text,\n\t\t\tserializeTreeNodes(treeNode.children, serializer),\n\t\t\ttreeNode.key,\n\t\t)\n\n\t\tif (serializedTreeNode != null) {\n\t\t\tserializedTreeNodes.push(serializedTreeNode)\n\t\t}\n\t}\n\n\treturn serializedTreeNodes\n}\n"],"names":[],"mappings":";AAqBa,MAAA,YAAY,CACxB,eACA,eAC2B;AAC3B,SAAO,mBACN,OAAO,aAAa,EAAE,UACtB,UAAU;AAEZ;AAEA,MAAM,qBAAqB,CAC1B,OACA,eACQ;AACR,QAAM,sBAA2B,CAAA;AAEjC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AAChC,UAAA,WAAW,MAAM,CAAC;AACxB,UAAM,qBAAqB,WAC1B,SAAS,MACT,SAAS,MACT,SAAS,MACT,mBAAmB,SAAS,UAAU,UAAU,GAChD,SAAS,GAAG;AAGb,QAAI,sBAAsB,MAAM;AAC/B,0BAAoB,KAAK,kBAAkB;AAAA,IAC5C;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../src/richtext/types.ts"],"sourcesContent":["import {\n\tRTAnyNode,\n\tRTEmNode,\n\tRTEmbedNode,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTImageNode,\n\tRTLabelNode,\n\tRTLinkNode,\n\tRTListItemNode,\n\tRTListNode,\n\tRTOListItemNode,\n\tRTOListNode,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTSpanNode,\n\tRTStrongNode,\n\
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/richtext/types.ts"],"sourcesContent":["import type {\n\tRTAnyNode,\n\tRTEmNode,\n\tRTEmbedNode,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTImageNode,\n\tRTLabelNode,\n\tRTLinkNode,\n\tRTListItemNode,\n\tRTListNode,\n\tRTOListItemNode,\n\tRTOListNode,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTSpanNode,\n\tRTStrongNode,\n\tRichTextNodeTypes,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\n\n// Serializers\n\n/**\n * Serializes a node from a rich text or title field with a function\n *\n * @typeParam ReturnType - Return type of the function serializer\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport type RichTextFunctionSerializer<ReturnType> = (\n\ttype: RichTextNodeTypes,\n\tnode: RTAnyNode,\n\ttext: string | undefined,\n\tchildren: ReturnType[],\n\tkey: string,\n) => ReturnType | null | undefined\n\n/**\n * Map serializer's tag function serializer, can be helpful for typing those\n * handlers\n *\n * @typeParam ReturnType - Return type of the tag serializer\n */\nexport type RichTextMapSerializerFunction<\n\tReturnType,\n\tNode extends RTAnyNode = RTAnyNode,\n\tTextType = string | undefined,\n> = (payload: {\n\ttype: Node[\"type\"]\n\tnode: Node\n\ttext: TextType\n\tchildren: ReturnType[]\n\tkey: string\n}) => ReturnType | null | undefined\n\n/**\n * Serializes a node from a rich text or title field with a map\n *\n * @remarks\n * This type of serializer needs to be processed through\n * {@link wrapMapSerializer} before being used with {@link serialize}\n *\n * @typeParam ReturnType - Return type of the map serializer\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport type RichTextMapSerializer<ReturnType> = {\n\theading1?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading1Node,\n\t\tundefined\n\t>\n\theading2?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading2Node,\n\t\tundefined\n\t>\n\theading3?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading3Node,\n\t\tundefined\n\t>\n\theading4?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading4Node,\n\t\tundefined\n\t>\n\theading5?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading5Node,\n\t\tundefined\n\t>\n\theading6?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading6Node,\n\t\tundefined\n\t>\n\tparagraph?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTParagraphNode,\n\t\tundefined\n\t>\n\tpreformatted?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTPreformattedNode,\n\t\tundefined\n\t>\n\tstrong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>\n\tem?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>\n\tlistItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTListItemNode,\n\t\tundefined\n\t>\n\toListItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTOListItemNode,\n\t\tundefined\n\t>\n\tlist?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>\n\toList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>\n\timage?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>\n\tembed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>\n\thyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>\n\tlabel?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>\n\tspan?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>\n}\n\n// Tree\nexport interface Tree {\n\tkey: string\n\tchildren: TreeNode[]\n}\n\nexport interface TreeNode {\n\tkey: string\n\ttype: RichTextNodeTypes\n\ttext?: string\n\tnode: RTAnyNode\n\tchildren: TreeNode[]\n}\n\n// Helpers\nexport const RichTextReversedNodeType = {\n\t[RichTextNodeType.listItem]: \"listItem\",\n\t[RichTextNodeType.oListItem]: \"oListItem\",\n\t[RichTextNodeType.list]: \"list\",\n\t[RichTextNodeType.oList]: \"oList\",\n} as const\n"],"names":["RichTextNodeType"],"mappings":";;;AAoJO,MAAM,2BAA2B;AAAA,EACvC,CAACA,SAAAA,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAACA,SAAAA,iBAAiB,SAAS,GAAG;AAAA,EAC9B,CAACA,SAAAA,iBAAiB,IAAI,GAAG;AAAA,EACzB,CAACA,SAAAA,iBAAiB,KAAK,GAAG;;;"}
|
package/dist/richtext/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RTAnyNode, RTEmNode, RTEmbedNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTImageNode, RTLabelNode, RTLinkNode, RTListItemNode, RTListNode, RTOListItemNode, RTOListNode, RTParagraphNode, RTPreformattedNode, RTSpanNode, RTStrongNode, RichTextNodeTypes } from "../types/value/richText";
|
|
1
|
+
import type { RTAnyNode, RTEmNode, RTEmbedNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTImageNode, RTLabelNode, RTLinkNode, RTListItemNode, RTListNode, RTOListItemNode, RTOListNode, RTParagraphNode, RTPreformattedNode, RTSpanNode, RTStrongNode, RichTextNodeTypes } from "../types/value/richText";
|
|
2
2
|
/**
|
|
3
3
|
* Serializes a node from a rich text or title field with a function
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/richtext/types.ts"],"sourcesContent":["import {\n\tRTAnyNode,\n\tRTEmNode,\n\tRTEmbedNode,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTImageNode,\n\tRTLabelNode,\n\tRTLinkNode,\n\tRTListItemNode,\n\tRTListNode,\n\tRTOListItemNode,\n\tRTOListNode,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTSpanNode,\n\tRTStrongNode,\n\
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/richtext/types.ts"],"sourcesContent":["import type {\n\tRTAnyNode,\n\tRTEmNode,\n\tRTEmbedNode,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTImageNode,\n\tRTLabelNode,\n\tRTLinkNode,\n\tRTListItemNode,\n\tRTListNode,\n\tRTOListItemNode,\n\tRTOListNode,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTSpanNode,\n\tRTStrongNode,\n\tRichTextNodeTypes,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\n\n// Serializers\n\n/**\n * Serializes a node from a rich text or title field with a function\n *\n * @typeParam ReturnType - Return type of the function serializer\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport type RichTextFunctionSerializer<ReturnType> = (\n\ttype: RichTextNodeTypes,\n\tnode: RTAnyNode,\n\ttext: string | undefined,\n\tchildren: ReturnType[],\n\tkey: string,\n) => ReturnType | null | undefined\n\n/**\n * Map serializer's tag function serializer, can be helpful for typing those\n * handlers\n *\n * @typeParam ReturnType - Return type of the tag serializer\n */\nexport type RichTextMapSerializerFunction<\n\tReturnType,\n\tNode extends RTAnyNode = RTAnyNode,\n\tTextType = string | undefined,\n> = (payload: {\n\ttype: Node[\"type\"]\n\tnode: Node\n\ttext: TextType\n\tchildren: ReturnType[]\n\tkey: string\n}) => ReturnType | null | undefined\n\n/**\n * Serializes a node from a rich text or title field with a map\n *\n * @remarks\n * This type of serializer needs to be processed through\n * {@link wrapMapSerializer} before being used with {@link serialize}\n *\n * @typeParam ReturnType - Return type of the map serializer\n *\n * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript}\n */\nexport type RichTextMapSerializer<ReturnType> = {\n\theading1?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading1Node,\n\t\tundefined\n\t>\n\theading2?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading2Node,\n\t\tundefined\n\t>\n\theading3?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading3Node,\n\t\tundefined\n\t>\n\theading4?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading4Node,\n\t\tundefined\n\t>\n\theading5?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading5Node,\n\t\tundefined\n\t>\n\theading6?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTHeading6Node,\n\t\tundefined\n\t>\n\tparagraph?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTParagraphNode,\n\t\tundefined\n\t>\n\tpreformatted?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTPreformattedNode,\n\t\tundefined\n\t>\n\tstrong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>\n\tem?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>\n\tlistItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTListItemNode,\n\t\tundefined\n\t>\n\toListItem?: RichTextMapSerializerFunction<\n\t\tReturnType,\n\t\tRTOListItemNode,\n\t\tundefined\n\t>\n\tlist?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>\n\toList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>\n\timage?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>\n\tembed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>\n\thyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>\n\tlabel?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>\n\tspan?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>\n}\n\n// Tree\nexport interface Tree {\n\tkey: string\n\tchildren: TreeNode[]\n}\n\nexport interface TreeNode {\n\tkey: string\n\ttype: RichTextNodeTypes\n\ttext?: string\n\tnode: RTAnyNode\n\tchildren: TreeNode[]\n}\n\n// Helpers\nexport const RichTextReversedNodeType = {\n\t[RichTextNodeType.listItem]: \"listItem\",\n\t[RichTextNodeType.oListItem]: \"oListItem\",\n\t[RichTextNodeType.list]: \"list\",\n\t[RichTextNodeType.oList]: \"oList\",\n} as const\n"],"names":[],"mappings":";AAoJO,MAAM,2BAA2B;AAAA,EACvC,CAAC,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAAC,iBAAiB,SAAS,GAAG;AAAA,EAC9B,CAAC,iBAAiB,IAAI,GAAG;AAAA,EACzB,CAAC,iBAAiB,KAAK,GAAG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapMapSerializer.cjs","sources":["../../../src/richtext/wrapMapSerializer.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"wrapMapSerializer.cjs","sources":["../../../src/richtext/wrapMapSerializer.ts"],"sourcesContent":["import type { RichTextFunctionSerializer, RichTextMapSerializer } from \"./types\"\nimport { RichTextReversedNodeType } from \"./types\"\n\n/**\n * Wraps a map serializer into a regular function serializer\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of the map serializer\n *\n * @param mapSerializer - Map serializer to wrap\n *\n * @returns A regular function serializer\n */\nexport const wrapMapSerializer = <SerializerReturnType>(\n\tmapSerializer: RichTextMapSerializer<SerializerReturnType>,\n): RichTextFunctionSerializer<SerializerReturnType> => {\n\treturn (type, node, text, children, key) => {\n\t\tconst tagSerializer: RichTextMapSerializer<SerializerReturnType>[keyof RichTextMapSerializer<SerializerReturnType>] =\n\t\t\tmapSerializer[\n\t\t\t\t(RichTextReversedNodeType[\n\t\t\t\t\ttype as keyof typeof RichTextReversedNodeType\n\t\t\t\t] || type) as keyof RichTextMapSerializer<SerializerReturnType>\n\t\t\t]\n\n\t\tif (tagSerializer) {\n\t\t\treturn tagSerializer({\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttype,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tnode,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttext,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tchildren,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tkey,\n\t\t\t})\n\t\t}\n\t}\n}\n"],"names":["RichTextReversedNodeType"],"mappings":";;;AAgBa,MAAA,oBAAoB,CAChC,kBACqD;AACrD,SAAO,CAAC,MAAM,MAAM,MAAM,UAAU,QAAO;AAC1C,UAAM,gBACL,cACEA,MAAAA,yBACA,IAA6C,KACzC,IAA0D;AAGjE,QAAI,eAAe;AAClB,aAAO,cAAc;AAAA;AAAA,QAEpB;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA,MAAA,CACA;AAAA,IACF;AAAA,EAAA;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapMapSerializer.js","sources":["../../../src/richtext/wrapMapSerializer.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"wrapMapSerializer.js","sources":["../../../src/richtext/wrapMapSerializer.ts"],"sourcesContent":["import type { RichTextFunctionSerializer, RichTextMapSerializer } from \"./types\"\nimport { RichTextReversedNodeType } from \"./types\"\n\n/**\n * Wraps a map serializer into a regular function serializer\n *\n * @remarks\n * This is a low level helper mainly intended to be used by higher level\n * packages Most users aren't expected to this function directly\n *\n * @typeParam SerializerReturnType - Return type of the map serializer\n *\n * @param mapSerializer - Map serializer to wrap\n *\n * @returns A regular function serializer\n */\nexport const wrapMapSerializer = <SerializerReturnType>(\n\tmapSerializer: RichTextMapSerializer<SerializerReturnType>,\n): RichTextFunctionSerializer<SerializerReturnType> => {\n\treturn (type, node, text, children, key) => {\n\t\tconst tagSerializer: RichTextMapSerializer<SerializerReturnType>[keyof RichTextMapSerializer<SerializerReturnType>] =\n\t\t\tmapSerializer[\n\t\t\t\t(RichTextReversedNodeType[\n\t\t\t\t\ttype as keyof typeof RichTextReversedNodeType\n\t\t\t\t] || type) as keyof RichTextMapSerializer<SerializerReturnType>\n\t\t\t]\n\n\t\tif (tagSerializer) {\n\t\t\treturn tagSerializer({\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttype,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tnode,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\ttext,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tchildren,\n\t\t\t\t// @ts-expect-error cannot type check here\n\t\t\t\tkey,\n\t\t\t})\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAgBa,MAAA,oBAAoB,CAChC,kBACqD;AACrD,SAAO,CAAC,MAAM,MAAM,MAAM,UAAU,QAAO;AAC1C,UAAM,gBACL,cACE,yBACA,IAA6C,KACzC,IAA0D;AAGjE,QAAI,eAAe;AAClB,aAAO,cAAc;AAAA;AAAA,QAEpB;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA,MAAA,CACA;AAAA,IACF;AAAA,EAAA;AAEF;"}
|