@prismicio/client 7.7.5-alpha.0 → 7.9.0-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/dist/index.cjs +0 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +1 -9
- package/dist/index.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/types/model/contentRelationship.d.ts +2 -0
- package/dist/types/model/link.cjs.map +1 -1
- package/dist/types/model/link.d.ts +2 -0
- package/dist/types/model/link.js.map +1 -1
- package/dist/types/model/linkToMedia.d.ts +2 -0
- package/dist/types/value/contentRelationship.d.ts +1 -0
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.ts +1 -0
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/linkToMedia.d.ts +1 -0
- package/package.json +2 -16
- package/src/index.ts +0 -8
- package/src/types/model/contentRelationship.ts +2 -0
- package/src/types/model/link.ts +3 -0
- package/src/types/model/linkToMedia.ts +2 -0
- package/src/types/value/contentRelationship.ts +1 -0
- package/src/types/value/link.ts +1 -0
- package/src/types/value/linkToMedia.ts +1 -0
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.cjs +0 -63
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.cjs.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.js +0 -63
- package/dist/_node_modules/@ungap/structured-clone/esm/deserialize.js.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/index.cjs +0 -12
- package/dist/_node_modules/@ungap/structured-clone/esm/index.cjs.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/index.js +0 -12
- package/dist/_node_modules/@ungap/structured-clone/esm/index.js.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.cjs +0 -127
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.cjs.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.js +0 -127
- package/dist/_node_modules/@ungap/structured-clone/esm/serialize.js.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/types.cjs +0 -23
- package/dist/_node_modules/@ungap/structured-clone/esm/types.cjs.map +0 -1
- package/dist/_node_modules/@ungap/structured-clone/esm/types.js +0 -23
- package/dist/_node_modules/@ungap/structured-clone/esm/types.js.map +0 -1
- package/dist/_node_modules/bail/index.cjs +0 -9
- package/dist/_node_modules/bail/index.cjs.map +0 -1
- package/dist/_node_modules/bail/index.js +0 -9
- package/dist/_node_modules/bail/index.js.map +0 -1
- package/dist/_node_modules/bcp-47-match/index.cjs +0 -74
- package/dist/_node_modules/bcp-47-match/index.cjs.map +0 -1
- package/dist/_node_modules/bcp-47-match/index.js +0 -74
- package/dist/_node_modules/bcp-47-match/index.js.map +0 -1
- package/dist/_node_modules/boolbase/index.cjs +0 -13
- package/dist/_node_modules/boolbase/index.cjs.map +0 -1
- package/dist/_node_modules/boolbase/index.js +0 -14
- package/dist/_node_modules/boolbase/index.js.map +0 -1
- package/dist/_node_modules/ccount/index.cjs +0 -17
- package/dist/_node_modules/ccount/index.cjs.map +0 -1
- package/dist/_node_modules/ccount/index.js +0 -17
- package/dist/_node_modules/ccount/index.js.map +0 -1
- package/dist/_node_modules/character-entities/index.cjs +0 -2131
- package/dist/_node_modules/character-entities/index.cjs.map +0 -1
- package/dist/_node_modules/character-entities/index.js +0 -2131
- package/dist/_node_modules/character-entities/index.js.map +0 -1
- package/dist/_node_modules/character-entities-html4/index.cjs +0 -258
- package/dist/_node_modules/character-entities-html4/index.cjs.map +0 -1
- package/dist/_node_modules/character-entities-html4/index.js +0 -258
- package/dist/_node_modules/character-entities-html4/index.js.map +0 -1
- package/dist/_node_modules/character-entities-legacy/index.cjs +0 -112
- package/dist/_node_modules/character-entities-legacy/index.cjs.map +0 -1
- package/dist/_node_modules/character-entities-legacy/index.js +0 -112
- package/dist/_node_modules/character-entities-legacy/index.js.map +0 -1
- package/dist/_node_modules/comma-separated-tokens/index.cjs +0 -32
- package/dist/_node_modules/comma-separated-tokens/index.cjs.map +0 -1
- package/dist/_node_modules/comma-separated-tokens/index.js +0 -32
- package/dist/_node_modules/comma-separated-tokens/index.js.map +0 -1
- package/dist/_node_modules/devlop/lib/default.cjs +0 -6
- package/dist/_node_modules/devlop/lib/default.cjs.map +0 -1
- package/dist/_node_modules/devlop/lib/default.js +0 -6
- package/dist/_node_modules/devlop/lib/default.js.map +0 -1
- package/dist/_node_modules/direction/index.cjs +0 -12
- package/dist/_node_modules/direction/index.cjs.map +0 -1
- package/dist/_node_modules/direction/index.js +0 -12
- package/dist/_node_modules/direction/index.js.map +0 -1
- package/dist/_node_modules/extend/index.cjs +0 -89
- package/dist/_node_modules/extend/index.cjs.map +0 -1
- package/dist/_node_modules/extend/index.js +0 -90
- package/dist/_node_modules/extend/index.js.map +0 -1
- package/dist/_node_modules/hast-util-embedded/lib/index.cjs +0 -14
- package/dist/_node_modules/hast-util-embedded/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-embedded/lib/index.js +0 -14
- package/dist/_node_modules/hast-util-embedded/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-from-html/lib/errors.cjs +0 -317
- package/dist/_node_modules/hast-util-from-html/lib/errors.cjs.map +0 -1
- package/dist/_node_modules/hast-util-from-html/lib/errors.js +0 -317
- package/dist/_node_modules/hast-util-from-html/lib/errors.js.map +0 -1
- package/dist/_node_modules/hast-util-from-html/lib/index.cjs +0 -96
- package/dist/_node_modules/hast-util-from-html/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-from-html/lib/index.js +0 -96
- package/dist/_node_modules/hast-util-from-html/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-from-parse5/lib/index.cjs +0 -187
- package/dist/_node_modules/hast-util-from-parse5/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-from-parse5/lib/index.js +0 -187
- package/dist/_node_modules/hast-util-from-parse5/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-has-property/lib/index.cjs +0 -9
- package/dist/_node_modules/hast-util-has-property/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-has-property/lib/index.js +0 -9
- package/dist/_node_modules/hast-util-has-property/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-is-element/lib/index.cjs +0 -102
- package/dist/_node_modules/hast-util-is-element/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-is-element/lib/index.js +0 -102
- package/dist/_node_modules/hast-util-is-element/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-parse-selector/lib/index.cjs +0 -40
- package/dist/_node_modules/hast-util-parse-selector/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-parse-selector/lib/index.js +0 -40
- package/dist/_node_modules/hast-util-parse-selector/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/attribute.cjs +0 -67
- package/dist/_node_modules/hast-util-select/lib/attribute.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/attribute.js +0 -67
- package/dist/_node_modules/hast-util-select/lib/attribute.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/class-name.cjs +0 -12
- package/dist/_node_modules/hast-util-select/lib/class-name.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/class-name.js +0 -12
- package/dist/_node_modules/hast-util-select/lib/class-name.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/enter-state.cjs +0 -79
- package/dist/_node_modules/hast-util-select/lib/enter-state.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/enter-state.js +0 -79
- package/dist/_node_modules/hast-util-select/lib/enter-state.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/id.cjs +0 -7
- package/dist/_node_modules/hast-util-select/lib/id.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/id.js +0 -7
- package/dist/_node_modules/hast-util-select/lib/id.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/index.cjs +0 -38
- package/dist/_node_modules/hast-util-select/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/index.js +0 -38
- package/dist/_node_modules/hast-util-select/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/name.cjs +0 -7
- package/dist/_node_modules/hast-util-select/lib/name.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/name.js +0 -7
- package/dist/_node_modules/hast-util-select/lib/name.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/parse.cjs +0 -12
- package/dist/_node_modules/hast-util-select/lib/parse.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/parse.js +0 -12
- package/dist/_node_modules/hast-util-select/lib/parse.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/pseudo.cjs +0 -231
- package/dist/_node_modules/hast-util-select/lib/pseudo.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/pseudo.js +0 -231
- package/dist/_node_modules/hast-util-select/lib/pseudo.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/test.cjs +0 -27
- package/dist/_node_modules/hast-util-select/lib/test.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/test.js +0 -27
- package/dist/_node_modules/hast-util-select/lib/test.js.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/walk.cjs +0 -132
- package/dist/_node_modules/hast-util-select/lib/walk.cjs.map +0 -1
- package/dist/_node_modules/hast-util-select/lib/walk.js +0 -132
- package/dist/_node_modules/hast-util-select/lib/walk.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.cjs +0 -24
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.js +0 -24
- package/dist/_node_modules/hast-util-to-html/lib/handle/comment.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.cjs +0 -7
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.js +0 -7
- package/dist/_node_modules/hast-util-to-html/lib/handle/doctype.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.cjs +0 -137
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.js +0 -137
- package/dist/_node_modules/hast-util-to-html/lib/handle/element.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.cjs +0 -26
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.js +0 -26
- package/dist/_node_modules/hast-util-to-html/lib/handle/index.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.cjs +0 -8
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.js +0 -8
- package/dist/_node_modules/hast-util-to-html/lib/handle/raw.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.cjs +0 -7
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.js +0 -7
- package/dist/_node_modules/hast-util-to-html/lib/handle/root.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.cjs +0 -14
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.js +0 -14
- package/dist/_node_modules/hast-util-to-html/lib/handle/text.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/index.cjs +0 -62
- package/dist/_node_modules/hast-util-to-html/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/index.js +0 -62
- package/dist/_node_modules/hast-util-to-html/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.cjs +0 -92
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.js +0 -92
- package/dist/_node_modules/hast-util-to-html/lib/omission/closing.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.cjs +0 -11
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.js +0 -11
- package/dist/_node_modules/hast-util-to-html/lib/omission/omission.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.cjs +0 -52
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.js +0 -52
- package/dist/_node_modules/hast-util-to-html/lib/omission/opening.js.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.cjs +0 -24
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.js +0 -24
- package/dist/_node_modules/hast-util-to-html/lib/omission/util/siblings.js.map +0 -1
- package/dist/_node_modules/hast-util-to-string/lib/index.cjs +0 -24
- package/dist/_node_modules/hast-util-to-string/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-to-string/lib/index.js +0 -24
- package/dist/_node_modules/hast-util-to-string/lib/index.js.map +0 -1
- package/dist/_node_modules/hast-util-whitespace/lib/index.cjs +0 -11
- package/dist/_node_modules/hast-util-whitespace/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hast-util-whitespace/lib/index.js +0 -11
- package/dist/_node_modules/hast-util-whitespace/lib/index.js.map +0 -1
- package/dist/_node_modules/hastscript/lib/create-h.cjs +0 -159
- package/dist/_node_modules/hastscript/lib/create-h.cjs.map +0 -1
- package/dist/_node_modules/hastscript/lib/create-h.js +0 -159
- package/dist/_node_modules/hastscript/lib/create-h.js.map +0 -1
- package/dist/_node_modules/hastscript/lib/index.cjs +0 -10
- package/dist/_node_modules/hastscript/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hastscript/lib/index.js +0 -10
- package/dist/_node_modules/hastscript/lib/index.js.map +0 -1
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +0 -45
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.map +0 -1
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +0 -45
- package/dist/_node_modules/hastscript/lib/svg-case-sensitive-tag-names.js.map +0 -1
- package/dist/_node_modules/html-void-elements/index.cjs +0 -26
- package/dist/_node_modules/html-void-elements/index.cjs.map +0 -1
- package/dist/_node_modules/html-void-elements/index.js +0 -26
- package/dist/_node_modules/html-void-elements/index.js.map +0 -1
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.cjs +0 -720
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.js +0 -720
- package/dist/_node_modules/mdast-util-from-markdown/lib/index.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.cjs +0 -116
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.js +0 -116
- package/dist/_node_modules/mdast-util-to-hast/lib/footer.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/blockquote.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.cjs +0 -9
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.js +0 -9
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/break.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.cjs +0 -25
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.js +0 -25
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/code.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/delete.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/emphasis.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs +0 -42
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +0 -42
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/heading.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.cjs +0 -12
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.js +0 -12
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/html.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs +0 -20
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +0 -20
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image-reference.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.cjs +0 -17
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.js +0 -17
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/image.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.cjs +0 -60
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.js +0 -60
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/index.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs +0 -16
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +0 -16
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/inline-code.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs +0 -25
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +0 -25
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link-reference.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.cjs +0 -19
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.js +0 -19
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/link.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs +0 -65
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.js +0 -65
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list-item.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.cjs +0 -27
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.js +0 -27
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/list.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/paragraph.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.cjs +0 -9
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.js +0 -9
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/root.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/strong.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs +0 -15
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +0 -15
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-cell.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs +0 -36
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.js +0 -36
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table-row.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.cjs +0 -40
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.js +0 -40
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/table.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.cjs +0 -10
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.js +0 -10
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/text.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +0 -14
- package/dist/_node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/index.cjs +0 -16
- package/dist/_node_modules/mdast-util-to-hast/lib/index.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/index.js +0 -16
- package/dist/_node_modules/mdast-util-to-hast/lib/index.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.cjs +0 -30
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.js +0 -30
- package/dist/_node_modules/mdast-util-to-hast/lib/revert.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/state.cjs +0 -149
- package/dist/_node_modules/mdast-util-to-hast/lib/state.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-hast/lib/state.js +0 -149
- package/dist/_node_modules/mdast-util-to-hast/lib/state.js.map +0 -1
- package/dist/_node_modules/mdast-util-to-string/lib/index.cjs +0 -39
- package/dist/_node_modules/mdast-util-to-string/lib/index.cjs.map +0 -1
- package/dist/_node_modules/mdast-util-to-string/lib/index.js +0 -39
- package/dist/_node_modules/mdast-util-to-string/lib/index.js.map +0 -1
- package/dist/_node_modules/micromark/lib/constructs.cjs +0 -94
- package/dist/_node_modules/micromark/lib/constructs.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/constructs.js +0 -94
- package/dist/_node_modules/micromark/lib/constructs.js.map +0 -1
- package/dist/_node_modules/micromark/lib/create-tokenizer.cjs +0 -316
- package/dist/_node_modules/micromark/lib/create-tokenizer.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/create-tokenizer.js +0 -316
- package/dist/_node_modules/micromark/lib/create-tokenizer.js.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/content.cjs +0 -58
- package/dist/_node_modules/micromark/lib/initialize/content.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/content.js +0 -58
- package/dist/_node_modules/micromark/lib/initialize/content.js.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/document.cjs +0 -212
- package/dist/_node_modules/micromark/lib/initialize/document.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/document.js +0 -212
- package/dist/_node_modules/micromark/lib/initialize/document.js.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/flow.cjs +0 -55
- package/dist/_node_modules/micromark/lib/initialize/flow.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/flow.js +0 -55
- package/dist/_node_modules/micromark/lib/initialize/flow.js.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/text.cjs +0 -143
- package/dist/_node_modules/micromark/lib/initialize/text.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/initialize/text.js +0 -143
- package/dist/_node_modules/micromark/lib/initialize/text.js.map +0 -1
- package/dist/_node_modules/micromark/lib/parse.cjs +0 -35
- package/dist/_node_modules/micromark/lib/parse.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/parse.js +0 -35
- package/dist/_node_modules/micromark/lib/parse.js.map +0 -1
- package/dist/_node_modules/micromark/lib/postprocess.cjs +0 -10
- package/dist/_node_modules/micromark/lib/postprocess.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/postprocess.js +0 -10
- package/dist/_node_modules/micromark/lib/postprocess.js.map +0 -1
- package/dist/_node_modules/micromark/lib/preprocess.cjs +0 -81
- package/dist/_node_modules/micromark/lib/preprocess.cjs.map +0 -1
- package/dist/_node_modules/micromark/lib/preprocess.js +0 -81
- package/dist/_node_modules/micromark/lib/preprocess.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.cjs +0 -116
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.js +0 -116
- package/dist/_node_modules/micromark-core-commonmark/lib/attention.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.cjs +0 -104
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.js +0 -104
- package/dist/_node_modules/micromark-core-commonmark/lib/autolink.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.cjs +0 -19
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.js +0 -19
- package/dist/_node_modules/micromark-core-commonmark/lib/blank-line.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.cjs +0 -62
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.js +0 -62
- package/dist/_node_modules/micromark-core-commonmark/lib/block-quote.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.cjs +0 -29
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.js +0 -29
- package/dist/_node_modules/micromark-core-commonmark/lib/character-escape.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.cjs +0 -69
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.js +0 -69
- package/dist/_node_modules/micromark-core-commonmark/lib/character-reference.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.cjs +0 -187
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.js +0 -187
- package/dist/_node_modules/micromark-core-commonmark/lib/code-fenced.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.cjs +0 -68
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.js +0 -68
- package/dist/_node_modules/micromark-core-commonmark/lib/code-indented.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.cjs +0 -117
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.js +0 -117
- package/dist/_node_modules/micromark-core-commonmark/lib/code-text.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/content.cjs +0 -76
- package/dist/_node_modules/micromark-core-commonmark/lib/content.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/content.js +0 -76
- package/dist/_node_modules/micromark-core-commonmark/lib/content.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.cjs +0 -95
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.js +0 -95
- package/dist/_node_modules/micromark-core-commonmark/lib/definition.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs +0 -24
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.js +0 -24
- package/dist/_node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.cjs +0 -96
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.js +0 -96
- package/dist/_node_modules/micromark-core-commonmark/lib/heading-atx.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.cjs +0 -384
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.js +0 -384
- package/dist/_node_modules/micromark-core-commonmark/lib/html-flow.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.cjs +0 -310
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.js +0 -310
- package/dist/_node_modules/micromark-core-commonmark/lib/html-text.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.cjs +0 -219
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.js +0 -219
- package/dist/_node_modules/micromark-core-commonmark/lib/label-end.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.cjs +0 -34
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.js +0 -34
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-image.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.cjs +0 -25
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.js +0 -25
- package/dist/_node_modules/micromark-core-commonmark/lib/label-start-link.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.cjs +0 -18
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.js +0 -18
- package/dist/_node_modules/micromark-core-commonmark/lib/line-ending.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/list.cjs +0 -136
- package/dist/_node_modules/micromark-core-commonmark/lib/list.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/list.js +0 -136
- package/dist/_node_modules/micromark-core-commonmark/lib/list.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.cjs +0 -90
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.js +0 -90
- package/dist/_node_modules/micromark-core-commonmark/lib/setext-underline.js.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.cjs +0 -43
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.cjs.map +0 -1
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.js +0 -43
- package/dist/_node_modules/micromark-core-commonmark/lib/thematic-break.js.map +0 -1
- package/dist/_node_modules/micromark-factory-destination/index.cjs +0 -95
- package/dist/_node_modules/micromark-factory-destination/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-factory-destination/index.js +0 -95
- package/dist/_node_modules/micromark-factory-destination/index.js.map +0 -1
- package/dist/_node_modules/micromark-factory-label/index.cjs +0 -64
- package/dist/_node_modules/micromark-factory-label/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-factory-label/index.js +0 -64
- package/dist/_node_modules/micromark-factory-label/index.js.map +0 -1
- package/dist/_node_modules/micromark-factory-space/index.cjs +0 -25
- package/dist/_node_modules/micromark-factory-space/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-factory-space/index.js +0 -25
- package/dist/_node_modules/micromark-factory-space/index.js.map +0 -1
- package/dist/_node_modules/micromark-factory-title/index.cjs +0 -66
- package/dist/_node_modules/micromark-factory-title/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-factory-title/index.js +0 -66
- package/dist/_node_modules/micromark-factory-title/index.js.map +0 -1
- package/dist/_node_modules/micromark-factory-whitespace/index.cjs +0 -27
- package/dist/_node_modules/micromark-factory-whitespace/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-factory-whitespace/index.js +0 -27
- package/dist/_node_modules/micromark-factory-whitespace/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-character/index.cjs +0 -45
- package/dist/_node_modules/micromark-util-character/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-character/index.js +0 -45
- package/dist/_node_modules/micromark-util-character/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-chunked/index.cjs +0 -37
- package/dist/_node_modules/micromark-util-chunked/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-chunked/index.js +0 -37
- package/dist/_node_modules/micromark-util-chunked/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-classify-character/index.cjs +0 -13
- package/dist/_node_modules/micromark-util-classify-character/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-classify-character/index.js +0 -13
- package/dist/_node_modules/micromark-util-classify-character/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-combine-extensions/index.cjs +0 -42
- package/dist/_node_modules/micromark-util-combine-extensions/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-combine-extensions/index.js +0 -42
- package/dist/_node_modules/micromark-util-combine-extensions/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.cjs +0 -20
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.js +0 -20
- package/dist/_node_modules/micromark-util-decode-numeric-character-reference/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-decode-string/index.cjs +0 -22
- package/dist/_node_modules/micromark-util-decode-string/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-decode-string/index.js +0 -22
- package/dist/_node_modules/micromark-util-decode-string/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-html-tag-name/index.cjs +0 -70
- package/dist/_node_modules/micromark-util-html-tag-name/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-html-tag-name/index.js +0 -70
- package/dist/_node_modules/micromark-util-html-tag-name/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-normalize-identifier/index.cjs +0 -7
- package/dist/_node_modules/micromark-util-normalize-identifier/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-normalize-identifier/index.js +0 -7
- package/dist/_node_modules/micromark-util-normalize-identifier/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-resolve-all/index.cjs +0 -16
- package/dist/_node_modules/micromark-util-resolve-all/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-resolve-all/index.js +0 -16
- package/dist/_node_modules/micromark-util-resolve-all/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-sanitize-uri/index.cjs +0 -42
- package/dist/_node_modules/micromark-util-sanitize-uri/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-sanitize-uri/index.js +0 -42
- package/dist/_node_modules/micromark-util-sanitize-uri/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-subtokenize/index.cjs +0 -149
- package/dist/_node_modules/micromark-util-subtokenize/index.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-subtokenize/index.js +0 -149
- package/dist/_node_modules/micromark-util-subtokenize/index.js.map +0 -1
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs +0 -195
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs.map +0 -1
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.js +0 -195
- package/dist/_node_modules/micromark-util-subtokenize/lib/splice-buffer.js.map +0 -1
- package/dist/_node_modules/nth-check/lib/esm/compile.cjs +0 -20
- package/dist/_node_modules/nth-check/lib/esm/compile.cjs.map +0 -1
- package/dist/_node_modules/nth-check/lib/esm/compile.js +0 -20
- package/dist/_node_modules/nth-check/lib/esm/compile.js.map +0 -1
- package/dist/_node_modules/nth-check/lib/esm/index.cjs +0 -11
- package/dist/_node_modules/nth-check/lib/esm/index.cjs.map +0 -1
- package/dist/_node_modules/nth-check/lib/esm/index.js +0 -11
- package/dist/_node_modules/nth-check/lib/esm/index.js.map +0 -1
- package/dist/_node_modules/nth-check/lib/esm/parse.cjs +0 -59
- package/dist/_node_modules/nth-check/lib/esm/parse.cjs.map +0 -1
- package/dist/_node_modules/nth-check/lib/esm/parse.js +0 -59
- package/dist/_node_modules/nth-check/lib/esm/parse.js.map +0 -1
- package/dist/_node_modules/property-information/index.cjs +0 -14
- package/dist/_node_modules/property-information/index.cjs.map +0 -1
- package/dist/_node_modules/property-information/index.js +0 -14
- package/dist/_node_modules/property-information/index.js.map +0 -1
- package/dist/_node_modules/property-information/lib/aria.cjs +0 -62
- package/dist/_node_modules/property-information/lib/aria.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/aria.js +0 -62
- package/dist/_node_modules/property-information/lib/aria.js.map +0 -1
- package/dist/_node_modules/property-information/lib/find.cjs +0 -41
- package/dist/_node_modules/property-information/lib/find.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/find.js +0 -41
- package/dist/_node_modules/property-information/lib/find.js.map +0 -1
- package/dist/_node_modules/property-information/lib/html.cjs +0 -369
- package/dist/_node_modules/property-information/lib/html.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/html.js +0 -369
- package/dist/_node_modules/property-information/lib/html.js.map +0 -1
- package/dist/_node_modules/property-information/lib/normalize.cjs +0 -7
- package/dist/_node_modules/property-information/lib/normalize.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/normalize.js +0 -7
- package/dist/_node_modules/property-information/lib/normalize.js.map +0 -1
- package/dist/_node_modules/property-information/lib/svg.cjs +0 -567
- package/dist/_node_modules/property-information/lib/svg.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/svg.js +0 -567
- package/dist/_node_modules/property-information/lib/svg.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.cjs +0 -8
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.js +0 -8
- package/dist/_node_modules/property-information/lib/util/case-insensitive-transform.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.cjs +0 -7
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.js +0 -7
- package/dist/_node_modules/property-information/lib/util/case-sensitive-transform.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/create.cjs +0 -31
- package/dist/_node_modules/property-information/lib/util/create.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/create.js +0 -31
- package/dist/_node_modules/property-information/lib/util/create.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/defined-info.cjs +0 -33
- package/dist/_node_modules/property-information/lib/util/defined-info.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/defined-info.js +0 -33
- package/dist/_node_modules/property-information/lib/util/defined-info.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/info.cjs +0 -25
- package/dist/_node_modules/property-information/lib/util/info.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/info.js +0 -25
- package/dist/_node_modules/property-information/lib/util/info.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/merge.cjs +0 -15
- package/dist/_node_modules/property-information/lib/util/merge.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/merge.js +0 -15
- package/dist/_node_modules/property-information/lib/util/merge.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/schema.cjs +0 -22
- package/dist/_node_modules/property-information/lib/util/schema.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/schema.js +0 -22
- package/dist/_node_modules/property-information/lib/util/schema.js.map +0 -1
- package/dist/_node_modules/property-information/lib/util/types.cjs +0 -21
- package/dist/_node_modules/property-information/lib/util/types.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/util/types.js +0 -21
- package/dist/_node_modules/property-information/lib/util/types.js.map +0 -1
- package/dist/_node_modules/property-information/lib/xlink.cjs +0 -20
- package/dist/_node_modules/property-information/lib/xlink.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/xlink.js +0 -20
- package/dist/_node_modules/property-information/lib/xlink.js.map +0 -1
- package/dist/_node_modules/property-information/lib/xml.cjs +0 -12
- package/dist/_node_modules/property-information/lib/xml.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/xml.js +0 -12
- package/dist/_node_modules/property-information/lib/xml.js.map +0 -1
- package/dist/_node_modules/property-information/lib/xmlns.cjs +0 -12
- package/dist/_node_modules/property-information/lib/xmlns.cjs.map +0 -1
- package/dist/_node_modules/property-information/lib/xmlns.js +0 -12
- package/dist/_node_modules/property-information/lib/xmlns.js.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.cjs +0 -122
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.cjs.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.js +0 -122
- package/dist/_node_modules/rehype-minify-whitespace/lib/block.js.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.cjs +0 -11
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.cjs.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.js +0 -11
- package/dist/_node_modules/rehype-minify-whitespace/lib/content.js.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.cjs +0 -169
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.cjs.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.js +0 -170
- package/dist/_node_modules/rehype-minify-whitespace/lib/index.js.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.cjs +0 -24
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.cjs.map +0 -1
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.js +0 -24
- package/dist/_node_modules/rehype-minify-whitespace/lib/skippable.js.map +0 -1
- package/dist/_node_modules/rehype-parse/lib/index.cjs +0 -21
- package/dist/_node_modules/rehype-parse/lib/index.cjs.map +0 -1
- package/dist/_node_modules/rehype-parse/lib/index.js +0 -22
- package/dist/_node_modules/rehype-parse/lib/index.js.map +0 -1
- package/dist/_node_modules/remark-parse/lib/index.cjs +0 -19
- package/dist/_node_modules/remark-parse/lib/index.cjs.map +0 -1
- package/dist/_node_modules/remark-parse/lib/index.js +0 -20
- package/dist/_node_modules/remark-parse/lib/index.js.map +0 -1
- package/dist/_node_modules/remark-rehype/lib/index.cjs +0 -21
- package/dist/_node_modules/remark-rehype/lib/index.cjs.map +0 -1
- package/dist/_node_modules/remark-rehype/lib/index.js +0 -22
- package/dist/_node_modules/remark-rehype/lib/index.js.map +0 -1
- package/dist/_node_modules/space-separated-tokens/index.cjs +0 -12
- package/dist/_node_modules/space-separated-tokens/index.cjs.map +0 -1
- package/dist/_node_modules/space-separated-tokens/index.js +0 -12
- package/dist/_node_modules/space-separated-tokens/index.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.cjs +0 -14
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.js +0 -14
- package/dist/_node_modules/stringify-entities/lib/constant/dangerous.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/core.cjs +0 -52
- package/dist/_node_modules/stringify-entities/lib/core.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/core.js +0 -52
- package/dist/_node_modules/stringify-entities/lib/core.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/index.cjs +0 -9
- package/dist/_node_modules/stringify-entities/lib/index.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/index.js +0 -9
- package/dist/_node_modules/stringify-entities/lib/index.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.cjs +0 -26
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.js +0 -26
- package/dist/_node_modules/stringify-entities/lib/util/format-smart.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.cjs +0 -9
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.js +0 -9
- package/dist/_node_modules/stringify-entities/lib/util/to-decimal.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.cjs +0 -9
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.js +0 -9
- package/dist/_node_modules/stringify-entities/lib/util/to-hexadecimal.js.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/to-named.cjs +0 -28
- package/dist/_node_modules/stringify-entities/lib/util/to-named.cjs.map +0 -1
- package/dist/_node_modules/stringify-entities/lib/util/to-named.js +0 -28
- package/dist/_node_modules/stringify-entities/lib/util/to-named.js.map +0 -1
- package/dist/_node_modules/trim-lines/index.cjs +0 -42
- package/dist/_node_modules/trim-lines/index.cjs.map +0 -1
- package/dist/_node_modules/trim-lines/index.js +0 -42
- package/dist/_node_modules/trim-lines/index.js.map +0 -1
- package/dist/_node_modules/trough/lib/index.cjs +0 -87
- package/dist/_node_modules/trough/lib/index.cjs.map +0 -1
- package/dist/_node_modules/trough/lib/index.js +0 -87
- package/dist/_node_modules/trough/lib/index.js.map +0 -1
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.cjs +0 -10
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.cjs.map +0 -1
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.js +0 -11
- package/dist/_node_modules/unified/_node_modules/is-plain-obj/index.js.map +0 -1
- package/dist/_node_modules/unified/lib/callable-instance.cjs +0 -31
- package/dist/_node_modules/unified/lib/callable-instance.cjs.map +0 -1
- package/dist/_node_modules/unified/lib/callable-instance.js +0 -31
- package/dist/_node_modules/unified/lib/callable-instance.js.map +0 -1
- package/dist/_node_modules/unified/lib/index.cjs +0 -637
- package/dist/_node_modules/unified/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unified/lib/index.js +0 -637
- package/dist/_node_modules/unified/lib/index.js.map +0 -1
- package/dist/_node_modules/unist-util-is/lib/index.cjs +0 -94
- package/dist/_node_modules/unist-util-is/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unist-util-is/lib/index.js +0 -94
- package/dist/_node_modules/unist-util-is/lib/index.js.map +0 -1
- package/dist/_node_modules/unist-util-position/lib/index.cjs +0 -28
- package/dist/_node_modules/unist-util-position/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unist-util-position/lib/index.js +0 -28
- package/dist/_node_modules/unist-util-position/lib/index.js.map +0 -1
- package/dist/_node_modules/unist-util-remove/lib/index.cjs +0 -39
- package/dist/_node_modules/unist-util-remove/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unist-util-remove/lib/index.js +0 -39
- package/dist/_node_modules/unist-util-remove/lib/index.js.map +0 -1
- package/dist/_node_modules/unist-util-stringify-position/lib/index.cjs +0 -28
- package/dist/_node_modules/unist-util-stringify-position/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unist-util-stringify-position/lib/index.js +0 -28
- package/dist/_node_modules/unist-util-stringify-position/lib/index.js.map +0 -1
- package/dist/_node_modules/unist-util-visit/lib/index.cjs +0 -28
- package/dist/_node_modules/unist-util-visit/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unist-util-visit/lib/index.js +0 -29
- package/dist/_node_modules/unist-util-visit/lib/index.js.map +0 -1
- package/dist/_node_modules/unist-util-visit-parents/lib/color.cjs +0 -7
- package/dist/_node_modules/unist-util-visit-parents/lib/color.cjs.map +0 -1
- package/dist/_node_modules/unist-util-visit-parents/lib/color.js +0 -7
- package/dist/_node_modules/unist-util-visit-parents/lib/color.js.map +0 -1
- package/dist/_node_modules/unist-util-visit-parents/lib/index.cjs +0 -84
- package/dist/_node_modules/unist-util-visit-parents/lib/index.cjs.map +0 -1
- package/dist/_node_modules/unist-util-visit-parents/lib/index.js +0 -84
- package/dist/_node_modules/unist-util-visit-parents/lib/index.js.map +0 -1
- package/dist/_node_modules/vfile/lib/index.cjs +0 -463
- package/dist/_node_modules/vfile/lib/index.cjs.map +0 -1
- package/dist/_node_modules/vfile/lib/index.js +0 -463
- package/dist/_node_modules/vfile/lib/index.js.map +0 -1
- package/dist/_node_modules/vfile/lib/minpath.browser.cjs +0 -215
- package/dist/_node_modules/vfile/lib/minpath.browser.cjs.map +0 -1
- package/dist/_node_modules/vfile/lib/minpath.browser.js +0 -215
- package/dist/_node_modules/vfile/lib/minpath.browser.js.map +0 -1
- package/dist/_node_modules/vfile/lib/minproc.browser.cjs +0 -8
- package/dist/_node_modules/vfile/lib/minproc.browser.cjs.map +0 -1
- package/dist/_node_modules/vfile/lib/minproc.browser.js +0 -8
- package/dist/_node_modules/vfile/lib/minproc.browser.js.map +0 -1
- package/dist/_node_modules/vfile/lib/minurl.browser.cjs +0 -47
- package/dist/_node_modules/vfile/lib/minurl.browser.cjs.map +0 -1
- package/dist/_node_modules/vfile/lib/minurl.browser.js +0 -47
- package/dist/_node_modules/vfile/lib/minurl.browser.js.map +0 -1
- package/dist/_node_modules/vfile/lib/minurl.shared.cjs +0 -10
- package/dist/_node_modules/vfile/lib/minurl.shared.cjs.map +0 -1
- package/dist/_node_modules/vfile/lib/minurl.shared.js +0 -10
- package/dist/_node_modules/vfile/lib/minurl.shared.js.map +0 -1
- package/dist/_node_modules/vfile-location/lib/index.cjs +0 -50
- package/dist/_node_modules/vfile-location/lib/index.cjs.map +0 -1
- package/dist/_node_modules/vfile-location/lib/index.js +0 -50
- package/dist/_node_modules/vfile-location/lib/index.js.map +0 -1
- package/dist/_node_modules/vfile-message/lib/index.cjs +0 -139
- package/dist/_node_modules/vfile-message/lib/index.cjs.map +0 -1
- package/dist/_node_modules/vfile-message/lib/index.js +0 -139
- package/dist/_node_modules/vfile-message/lib/index.js.map +0 -1
- package/dist/_node_modules/web-namespaces/index.cjs +0 -12
- package/dist/_node_modules/web-namespaces/index.cjs.map +0 -1
- package/dist/_node_modules/web-namespaces/index.js +0 -12
- package/dist/_node_modules/web-namespaces/index.js.map +0 -1
- package/dist/_node_modules/zwitch/index.cjs +0 -23
- package/dist/_node_modules/zwitch/index.cjs.map +0 -1
- package/dist/_node_modules/zwitch/index.js +0 -23
- package/dist/_node_modules/zwitch/index.js.map +0 -1
- package/dist/_virtual/_commonjsHelpers.cjs +0 -7
- package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -7
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/index.cjs +0 -9
- package/dist/_virtual/index.cjs.map +0 -1
- package/dist/_virtual/index.js +0 -9
- package/dist/_virtual/index.js.map +0 -1
- package/dist/errors/PrismicRichTextError.cjs +0 -6
- package/dist/errors/PrismicRichTextError.cjs.map +0 -1
- package/dist/errors/PrismicRichTextError.d.ts +0 -2
- package/dist/errors/PrismicRichTextError.js +0 -6
- package/dist/errors/PrismicRichTextError.js.map +0 -1
- package/dist/errors/PrismicRichTextSerializerError.cjs +0 -7
- package/dist/errors/PrismicRichTextSerializerError.cjs.map +0 -1
- package/dist/errors/PrismicRichTextSerializerError.d.ts +0 -3
- package/dist/errors/PrismicRichTextSerializerError.js +0 -7
- package/dist/errors/PrismicRichTextSerializerError.js.map +0 -1
- package/dist/helpers/unstable_htmlAsRichText.cjs +0 -11
- package/dist/helpers/unstable_htmlAsRichText.cjs.map +0 -1
- package/dist/helpers/unstable_htmlAsRichText.d.ts +0 -81
- package/dist/helpers/unstable_htmlAsRichText.js +0 -11
- package/dist/helpers/unstable_htmlAsRichText.js.map +0 -1
- package/dist/helpers/unstable_markdownAsRichText.cjs +0 -12
- package/dist/helpers/unstable_markdownAsRichText.cjs.map +0 -1
- package/dist/helpers/unstable_markdownAsRichText.d.ts +0 -30
- package/dist/helpers/unstable_markdownAsRichText.js +0 -12
- package/dist/helpers/unstable_markdownAsRichText.js.map +0 -1
- package/dist/lib/RichTextFieldBuilder.cjs +0 -115
- package/dist/lib/RichTextFieldBuilder.cjs.map +0 -1
- package/dist/lib/RichTextFieldBuilder.d.ts +0 -35
- package/dist/lib/RichTextFieldBuilder.js +0 -115
- package/dist/lib/RichTextFieldBuilder.js.map +0 -1
- package/dist/lib/filterRichTextField.cjs +0 -88
- package/dist/lib/filterRichTextField.cjs.map +0 -1
- package/dist/lib/filterRichTextField.d.ts +0 -12
- package/dist/lib/filterRichTextField.js +0 -88
- package/dist/lib/filterRichTextField.js.map +0 -1
- package/dist/lib/hastSerializerHelpers.cjs +0 -96
- package/dist/lib/hastSerializerHelpers.cjs.map +0 -1
- package/dist/lib/hastSerializerHelpers.d.ts +0 -28
- package/dist/lib/hastSerializerHelpers.js +0 -96
- package/dist/lib/hastSerializerHelpers.js.map +0 -1
- package/dist/lib/hastToRichText.cjs +0 -164
- package/dist/lib/hastToRichText.cjs.map +0 -1
- package/dist/lib/hastToRichText.d.ts +0 -30
- package/dist/lib/hastToRichText.js +0 -164
- package/dist/lib/hastToRichText.js.map +0 -1
- package/dist/lib/rehypeRichText.cjs +0 -60
- package/dist/lib/rehypeRichText.cjs.map +0 -1
- package/dist/lib/rehypeRichText.d.ts +0 -66
- package/dist/lib/rehypeRichText.js +0 -60
- package/dist/lib/rehypeRichText.js.map +0 -1
- package/src/errors/PrismicRichTextError.ts +0 -1
- package/src/errors/PrismicRichTextSerializerError.ts +0 -3
- package/src/helpers/unstable_htmlAsRichText.ts +0 -122
- package/src/helpers/unstable_markdownAsRichText.ts +0 -53
- package/src/lib/RichTextFieldBuilder.ts +0 -164
- package/src/lib/filterRichTextField.ts +0 -159
- package/src/lib/hastSerializerHelpers.ts +0 -157
- package/src/lib/hastToRichText.ts +0 -295
- package/src/lib/rehypeRichText.ts +0 -184
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const link = require("../types/value/link.cjs");
|
|
4
|
-
const richText = require("../types/value/richText.cjs");
|
|
5
|
-
const getAllowedNodeTypes = (model) => {
|
|
6
|
-
var _a;
|
|
7
|
-
const allowedNodeTypes = [];
|
|
8
|
-
if (model.config) {
|
|
9
|
-
if ("multi" in model.config && model.config.multi) {
|
|
10
|
-
allowedNodeTypes.push(...model.config.multi.split(","));
|
|
11
|
-
} else if ("single" in model.config && model.config.single) {
|
|
12
|
-
allowedNodeTypes.push(...model.config.single.split(","));
|
|
13
|
-
}
|
|
14
|
-
if ((_a = model.config.labels) == null ? void 0 : _a.length) {
|
|
15
|
-
allowedNodeTypes.push("label");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return allowedNodeTypes;
|
|
19
|
-
};
|
|
20
|
-
const filterImageNode = (node, model) => {
|
|
21
|
-
var _a, _b;
|
|
22
|
-
if (!((_a = model.config) == null ? void 0 : _a.allowTargetBlank) && ((_b = node.linkTo) == null ? void 0 : _b.link_type) === link.LinkType.Web) {
|
|
23
|
-
return {
|
|
24
|
-
...node,
|
|
25
|
-
linkTo: {
|
|
26
|
-
...node.linkTo,
|
|
27
|
-
target: void 0
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
return node;
|
|
32
|
-
};
|
|
33
|
-
const filterTextNode = (node, model, allowedNodeTypes) => {
|
|
34
|
-
var _a, _b, _c;
|
|
35
|
-
const filteredNode = {
|
|
36
|
-
...node,
|
|
37
|
-
spans: []
|
|
38
|
-
};
|
|
39
|
-
for (let i = 0; i < node.spans.length; i++) {
|
|
40
|
-
const span = node.spans[i];
|
|
41
|
-
if (allowedNodeTypes.includes(span.type)) {
|
|
42
|
-
if (span.type === richText.RichTextNodeType.hyperlink) {
|
|
43
|
-
if (!((_a = model.config) == null ? void 0 : _a.allowTargetBlank) && span.data.link_type === link.LinkType.Web) {
|
|
44
|
-
filteredNode.spans.push({
|
|
45
|
-
...span,
|
|
46
|
-
data: {
|
|
47
|
-
...span.data,
|
|
48
|
-
target: void 0
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
} else {
|
|
52
|
-
filteredNode.spans.push(span);
|
|
53
|
-
}
|
|
54
|
-
} else if (span.type === richText.RichTextNodeType.label) {
|
|
55
|
-
if ((_c = (_b = model.config) == null ? void 0 : _b.labels) == null ? void 0 : _c.includes(span.data.label)) {
|
|
56
|
-
filteredNode.spans.push(span);
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
filteredNode.spans.push(span);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return filteredNode;
|
|
64
|
-
};
|
|
65
|
-
const filterRichTextField = (richTextField, model) => {
|
|
66
|
-
const nodes = [];
|
|
67
|
-
const allowedNodeTypes = getAllowedNodeTypes(model);
|
|
68
|
-
for (
|
|
69
|
-
let i = 0;
|
|
70
|
-
// Only process the first node if it's a "single" node rich text type
|
|
71
|
-
i < (model.config && "multi" in model.config ? richTextField.length : 1);
|
|
72
|
-
i++
|
|
73
|
-
) {
|
|
74
|
-
const node = richTextField[i];
|
|
75
|
-
if (allowedNodeTypes.includes(node.type)) {
|
|
76
|
-
if (node.type === richText.RichTextNodeType.image) {
|
|
77
|
-
nodes.push(filterImageNode(node, model));
|
|
78
|
-
} else if (node.type === richText.RichTextNodeType.embed) {
|
|
79
|
-
nodes.push(node);
|
|
80
|
-
} else {
|
|
81
|
-
nodes.push(filterTextNode(node, model, allowedNodeTypes));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return nodes;
|
|
86
|
-
};
|
|
87
|
-
exports.filterRichTextField = filterRichTextField;
|
|
88
|
-
//# sourceMappingURL=filterRichTextField.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterRichTextField.cjs","sources":["../../../src/lib/filterRichTextField.ts"],"sourcesContent":["import type { CustomTypeModelRichTextField } from \"../types/model/richText\"\nimport { LinkType } from \"../types/value/link\"\nimport type {\n\tRTImageNode,\n\tRTNode,\n\tRTTextNode,\n\tRichTextField,\n\tRichTextNodeTypes,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\nimport type { TitleField } from \"../types/value/title\"\n\n/**\n * Get allowed nodes types from a rich text or title field custom type model.\n *\n * @param model - A rich text or title field custom type model.\n *\n * @returns An array of allowed nodes types.\n */\nconst getAllowedNodeTypes = (\n\tmodel: CustomTypeModelRichTextField,\n): RichTextNodeTypes[] => {\n\tconst allowedNodeTypes: RichTextNodeTypes[] = [] // An empty array means no nodes are allowed by default.\n\n\tif (model.config) {\n\t\tif (\"multi\" in model.config && model.config.multi) {\n\t\t\tallowedNodeTypes.push(\n\t\t\t\t...(model.config.multi.split(\",\") as RichTextNodeTypes[]),\n\t\t\t)\n\t\t} else if (\"single\" in model.config && model.config.single) {\n\t\t\tallowedNodeTypes.push(\n\t\t\t\t...(model.config.single.split(\",\") as RichTextNodeTypes[]),\n\t\t\t)\n\t\t}\n\n\t\tif (model.config.labels?.length) {\n\t\t\tallowedNodeTypes.push(\"label\")\n\t\t}\n\t}\n\n\treturn allowedNodeTypes\n}\n\n/**\n * Filter an image node based on given model.\n *\n * @param node - An image node to filter.\n * @param model - A rich text or title field custom type model.\n *\n * @returns A filtered image node based on the given model.\n */\nconst filterImageNode = (\n\tnode: RTImageNode,\n\tmodel: CustomTypeModelRichTextField,\n): RTImageNode => {\n\tif (\n\t\t!model.config?.allowTargetBlank &&\n\t\tnode.linkTo?.link_type === LinkType.Web\n\t) {\n\t\treturn {\n\t\t\t...node,\n\t\t\tlinkTo: {\n\t\t\t\t...node.linkTo,\n\t\t\t\ttarget: undefined,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn node\n}\n\n/**\n * Filter a text node based on given model.\n *\n * @param node - A text node to filter.\n * @param model - A rich text or title field custom type model.\n * @param allowedNodeTypes - An array of allowed nodes types.\n *\n * @returns A filtered text node based on the given model.\n */\nconst filterTextNode = (\n\tnode: RTTextNode,\n\tmodel: CustomTypeModelRichTextField,\n\tallowedNodeTypes: RichTextNodeTypes[],\n): RTTextNode => {\n\tconst filteredNode: RTTextNode = {\n\t\t...node,\n\t\tspans: [],\n\t}\n\n\tfor (let i = 0; i < node.spans.length; i++) {\n\t\tconst span = node.spans[i]\n\n\t\tif (allowedNodeTypes.includes(span.type)) {\n\t\t\tif (span.type === RichTextNodeType.hyperlink) {\n\t\t\t\tif (\n\t\t\t\t\t!model.config?.allowTargetBlank &&\n\t\t\t\t\tspan.data.link_type === LinkType.Web\n\t\t\t\t) {\n\t\t\t\t\tfilteredNode.spans.push({\n\t\t\t\t\t\t...span,\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t...span.data,\n\t\t\t\t\t\t\ttarget: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tfilteredNode.spans.push(span)\n\t\t\t\t}\n\t\t\t} else if (span.type === RichTextNodeType.label) {\n\t\t\t\tif (model.config?.labels?.includes(span.data.label)) {\n\t\t\t\t\tfilteredNode.spans.push(span)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfilteredNode.spans.push(span)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn filteredNode\n}\n\n/**\n * Filter a rich text field based on given model.\n *\n * @param richTextField - A rich text or title field from Prismic.\n * @param model - A rich text or title field custom type model.\n *\n * @returns A rich text or title field filtered based on the given model.\n */\nexport const filterRichTextField = <Field extends RichTextField | TitleField>(\n\trichTextField: Field,\n\tmodel: CustomTypeModelRichTextField,\n): Field => {\n\tconst nodes: RTNode[] = []\n\n\tconst allowedNodeTypes = getAllowedNodeTypes(model)\n\n\tfor (\n\t\tlet i = 0;\n\t\t// Only process the first node if it's a \"single\" node rich text type\n\t\ti < (model.config && \"multi\" in model.config ? richTextField.length : 1);\n\t\ti++\n\t) {\n\t\tconst node = richTextField[i]\n\n\t\tif (allowedNodeTypes.includes(node.type)) {\n\t\t\tif (node.type === RichTextNodeType.image) {\n\t\t\t\tnodes.push(filterImageNode(node, model))\n\t\t\t} else if (node.type === RichTextNodeType.embed) {\n\t\t\t\tnodes.push(node)\n\t\t\t} else {\n\t\t\t\tnodes.push(filterTextNode(node, model, allowedNodeTypes))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nodes as Field\n}\n"],"names":["LinkType","RichTextNodeType"],"mappings":";;;;AAmBA,MAAM,sBAAsB,CAC3B,UACwB;;AACxB,QAAM,mBAAwC,CAAA;AAE9C,MAAI,MAAM,QAAQ;AACjB,QAAI,WAAW,MAAM,UAAU,MAAM,OAAO,OAAO;AAClD,uBAAiB,KAChB,GAAI,MAAM,OAAO,MAAM,MAAM,GAAG,CAAyB;AAAA,IAAA,WAEhD,YAAY,MAAM,UAAU,MAAM,OAAO,QAAQ;AAC3D,uBAAiB,KAChB,GAAI,MAAM,OAAO,OAAO,MAAM,GAAG,CAAyB;AAAA,IAE5D;AAEI,SAAA,WAAM,OAAO,WAAb,mBAAqB,QAAQ;AAChC,uBAAiB,KAAK,OAAO;AAAA,IAC9B;AAAA,EACD;AAEO,SAAA;AACR;AAUA,MAAM,kBAAkB,CACvB,MACA,UACgB;;AAEf,MAAA,GAAC,WAAM,WAAN,mBAAc,uBACf,UAAK,WAAL,mBAAa,eAAcA,cAAS,KACnC;AACM,WAAA;AAAA,MACN,GAAG;AAAA,MACH,QAAQ;AAAA,QACP,GAAG,KAAK;AAAA,QACR,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEH;AAEO,SAAA;AACR;AAWA,MAAM,iBAAiB,CACtB,MACA,OACA,qBACe;;AACf,QAAM,eAA2B;AAAA,IAChC,GAAG;AAAA,IACH,OAAO,CAAE;AAAA,EAAA;AAGV,WAAS,IAAI,GAAG,IAAI,KAAK,MAAM,QAAQ,KAAK;AACrC,UAAA,OAAO,KAAK,MAAM,CAAC;AAEzB,QAAI,iBAAiB,SAAS,KAAK,IAAI,GAAG;AACrC,UAAA,KAAK,SAASC,SAAA,iBAAiB,WAAW;AAE5C,YAAA,GAAC,WAAM,WAAN,mBAAc,qBACf,KAAK,KAAK,cAAcD,cAAS,KAChC;AACD,uBAAa,MAAM,KAAK;AAAA,YACvB,GAAG;AAAA,YACH,MAAM;AAAA,cACL,GAAG,KAAK;AAAA,cACR,QAAQ;AAAA,YACR;AAAA,UAAA,CACD;AAAA,QAAA,OACK;AACO,uBAAA,MAAM,KAAK,IAAI;AAAA,QAC7B;AAAA,MACU,WAAA,KAAK,SAASC,SAAAA,iBAAiB,OAAO;AAChD,aAAI,iBAAM,WAAN,mBAAc,WAAd,mBAAsB,SAAS,KAAK,KAAK,QAAQ;AACvC,uBAAA,MAAM,KAAK,IAAI;AAAA,QAC7B;AAAA,MAAA,OACM;AACO,qBAAA,MAAM,KAAK,IAAI;AAAA,MAC7B;AAAA,IACD;AAAA,EACD;AAEO,SAAA;AACR;AAUa,MAAA,sBAAsB,CAClC,eACA,UACU;AACV,QAAM,QAAkB,CAAA;AAElB,QAAA,mBAAmB,oBAAoB,KAAK;AAElD;AAAA,QACK,IAAI;AAAA;AAAA,IAER,KAAK,MAAM,UAAU,WAAW,MAAM,SAAS,cAAc,SAAS;AAAA,IACtE;AAAA,IACC;AACK,UAAA,OAAO,cAAc,CAAC;AAE5B,QAAI,iBAAiB,SAAS,KAAK,IAAI,GAAG;AACrC,UAAA,KAAK,SAASA,SAAA,iBAAiB,OAAO;AACzC,cAAM,KAAK,gBAAgB,MAAM,KAAK,CAAC;AAAA,MAC7B,WAAA,KAAK,SAASA,SAAAA,iBAAiB,OAAO;AAChD,cAAM,KAAK,IAAI;AAAA,MAAA,OACT;AACN,cAAM,KAAK,eAAe,MAAM,OAAO,gBAAgB,CAAC;AAAA,MACzD;AAAA,IACD;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CustomTypeModelRichTextField } from "../types/model/richText";
|
|
2
|
-
import type { RichTextField } from "../types/value/richText";
|
|
3
|
-
import type { TitleField } from "../types/value/title";
|
|
4
|
-
/**
|
|
5
|
-
* Filter a rich text field based on given model.
|
|
6
|
-
*
|
|
7
|
-
* @param richTextField - A rich text or title field from Prismic.
|
|
8
|
-
* @param model - A rich text or title field custom type model.
|
|
9
|
-
*
|
|
10
|
-
* @returns A rich text or title field filtered based on the given model.
|
|
11
|
-
*/
|
|
12
|
-
export declare const filterRichTextField: <Field extends RichTextField | TitleField>(richTextField: Field, model: CustomTypeModelRichTextField) => Field;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { LinkType } from "../types/value/link.js";
|
|
2
|
-
import { RichTextNodeType } from "../types/value/richText.js";
|
|
3
|
-
const getAllowedNodeTypes = (model) => {
|
|
4
|
-
var _a;
|
|
5
|
-
const allowedNodeTypes = [];
|
|
6
|
-
if (model.config) {
|
|
7
|
-
if ("multi" in model.config && model.config.multi) {
|
|
8
|
-
allowedNodeTypes.push(...model.config.multi.split(","));
|
|
9
|
-
} else if ("single" in model.config && model.config.single) {
|
|
10
|
-
allowedNodeTypes.push(...model.config.single.split(","));
|
|
11
|
-
}
|
|
12
|
-
if ((_a = model.config.labels) == null ? void 0 : _a.length) {
|
|
13
|
-
allowedNodeTypes.push("label");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return allowedNodeTypes;
|
|
17
|
-
};
|
|
18
|
-
const filterImageNode = (node, model) => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
if (!((_a = model.config) == null ? void 0 : _a.allowTargetBlank) && ((_b = node.linkTo) == null ? void 0 : _b.link_type) === LinkType.Web) {
|
|
21
|
-
return {
|
|
22
|
-
...node,
|
|
23
|
-
linkTo: {
|
|
24
|
-
...node.linkTo,
|
|
25
|
-
target: void 0
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return node;
|
|
30
|
-
};
|
|
31
|
-
const filterTextNode = (node, model, allowedNodeTypes) => {
|
|
32
|
-
var _a, _b, _c;
|
|
33
|
-
const filteredNode = {
|
|
34
|
-
...node,
|
|
35
|
-
spans: []
|
|
36
|
-
};
|
|
37
|
-
for (let i = 0; i < node.spans.length; i++) {
|
|
38
|
-
const span = node.spans[i];
|
|
39
|
-
if (allowedNodeTypes.includes(span.type)) {
|
|
40
|
-
if (span.type === RichTextNodeType.hyperlink) {
|
|
41
|
-
if (!((_a = model.config) == null ? void 0 : _a.allowTargetBlank) && span.data.link_type === LinkType.Web) {
|
|
42
|
-
filteredNode.spans.push({
|
|
43
|
-
...span,
|
|
44
|
-
data: {
|
|
45
|
-
...span.data,
|
|
46
|
-
target: void 0
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
filteredNode.spans.push(span);
|
|
51
|
-
}
|
|
52
|
-
} else if (span.type === RichTextNodeType.label) {
|
|
53
|
-
if ((_c = (_b = model.config) == null ? void 0 : _b.labels) == null ? void 0 : _c.includes(span.data.label)) {
|
|
54
|
-
filteredNode.spans.push(span);
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
filteredNode.spans.push(span);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return filteredNode;
|
|
62
|
-
};
|
|
63
|
-
const filterRichTextField = (richTextField, model) => {
|
|
64
|
-
const nodes = [];
|
|
65
|
-
const allowedNodeTypes = getAllowedNodeTypes(model);
|
|
66
|
-
for (
|
|
67
|
-
let i = 0;
|
|
68
|
-
// Only process the first node if it's a "single" node rich text type
|
|
69
|
-
i < (model.config && "multi" in model.config ? richTextField.length : 1);
|
|
70
|
-
i++
|
|
71
|
-
) {
|
|
72
|
-
const node = richTextField[i];
|
|
73
|
-
if (allowedNodeTypes.includes(node.type)) {
|
|
74
|
-
if (node.type === RichTextNodeType.image) {
|
|
75
|
-
nodes.push(filterImageNode(node, model));
|
|
76
|
-
} else if (node.type === RichTextNodeType.embed) {
|
|
77
|
-
nodes.push(node);
|
|
78
|
-
} else {
|
|
79
|
-
nodes.push(filterTextNode(node, model, allowedNodeTypes));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return nodes;
|
|
84
|
-
};
|
|
85
|
-
export {
|
|
86
|
-
filterRichTextField
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=filterRichTextField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterRichTextField.js","sources":["../../../src/lib/filterRichTextField.ts"],"sourcesContent":["import type { CustomTypeModelRichTextField } from \"../types/model/richText\"\nimport { LinkType } from \"../types/value/link\"\nimport type {\n\tRTImageNode,\n\tRTNode,\n\tRTTextNode,\n\tRichTextField,\n\tRichTextNodeTypes,\n} from \"../types/value/richText\"\nimport { RichTextNodeType } from \"../types/value/richText\"\nimport type { TitleField } from \"../types/value/title\"\n\n/**\n * Get allowed nodes types from a rich text or title field custom type model.\n *\n * @param model - A rich text or title field custom type model.\n *\n * @returns An array of allowed nodes types.\n */\nconst getAllowedNodeTypes = (\n\tmodel: CustomTypeModelRichTextField,\n): RichTextNodeTypes[] => {\n\tconst allowedNodeTypes: RichTextNodeTypes[] = [] // An empty array means no nodes are allowed by default.\n\n\tif (model.config) {\n\t\tif (\"multi\" in model.config && model.config.multi) {\n\t\t\tallowedNodeTypes.push(\n\t\t\t\t...(model.config.multi.split(\",\") as RichTextNodeTypes[]),\n\t\t\t)\n\t\t} else if (\"single\" in model.config && model.config.single) {\n\t\t\tallowedNodeTypes.push(\n\t\t\t\t...(model.config.single.split(\",\") as RichTextNodeTypes[]),\n\t\t\t)\n\t\t}\n\n\t\tif (model.config.labels?.length) {\n\t\t\tallowedNodeTypes.push(\"label\")\n\t\t}\n\t}\n\n\treturn allowedNodeTypes\n}\n\n/**\n * Filter an image node based on given model.\n *\n * @param node - An image node to filter.\n * @param model - A rich text or title field custom type model.\n *\n * @returns A filtered image node based on the given model.\n */\nconst filterImageNode = (\n\tnode: RTImageNode,\n\tmodel: CustomTypeModelRichTextField,\n): RTImageNode => {\n\tif (\n\t\t!model.config?.allowTargetBlank &&\n\t\tnode.linkTo?.link_type === LinkType.Web\n\t) {\n\t\treturn {\n\t\t\t...node,\n\t\t\tlinkTo: {\n\t\t\t\t...node.linkTo,\n\t\t\t\ttarget: undefined,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn node\n}\n\n/**\n * Filter a text node based on given model.\n *\n * @param node - A text node to filter.\n * @param model - A rich text or title field custom type model.\n * @param allowedNodeTypes - An array of allowed nodes types.\n *\n * @returns A filtered text node based on the given model.\n */\nconst filterTextNode = (\n\tnode: RTTextNode,\n\tmodel: CustomTypeModelRichTextField,\n\tallowedNodeTypes: RichTextNodeTypes[],\n): RTTextNode => {\n\tconst filteredNode: RTTextNode = {\n\t\t...node,\n\t\tspans: [],\n\t}\n\n\tfor (let i = 0; i < node.spans.length; i++) {\n\t\tconst span = node.spans[i]\n\n\t\tif (allowedNodeTypes.includes(span.type)) {\n\t\t\tif (span.type === RichTextNodeType.hyperlink) {\n\t\t\t\tif (\n\t\t\t\t\t!model.config?.allowTargetBlank &&\n\t\t\t\t\tspan.data.link_type === LinkType.Web\n\t\t\t\t) {\n\t\t\t\t\tfilteredNode.spans.push({\n\t\t\t\t\t\t...span,\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t...span.data,\n\t\t\t\t\t\t\ttarget: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tfilteredNode.spans.push(span)\n\t\t\t\t}\n\t\t\t} else if (span.type === RichTextNodeType.label) {\n\t\t\t\tif (model.config?.labels?.includes(span.data.label)) {\n\t\t\t\t\tfilteredNode.spans.push(span)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfilteredNode.spans.push(span)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn filteredNode\n}\n\n/**\n * Filter a rich text field based on given model.\n *\n * @param richTextField - A rich text or title field from Prismic.\n * @param model - A rich text or title field custom type model.\n *\n * @returns A rich text or title field filtered based on the given model.\n */\nexport const filterRichTextField = <Field extends RichTextField | TitleField>(\n\trichTextField: Field,\n\tmodel: CustomTypeModelRichTextField,\n): Field => {\n\tconst nodes: RTNode[] = []\n\n\tconst allowedNodeTypes = getAllowedNodeTypes(model)\n\n\tfor (\n\t\tlet i = 0;\n\t\t// Only process the first node if it's a \"single\" node rich text type\n\t\ti < (model.config && \"multi\" in model.config ? richTextField.length : 1);\n\t\ti++\n\t) {\n\t\tconst node = richTextField[i]\n\n\t\tif (allowedNodeTypes.includes(node.type)) {\n\t\t\tif (node.type === RichTextNodeType.image) {\n\t\t\t\tnodes.push(filterImageNode(node, model))\n\t\t\t} else if (node.type === RichTextNodeType.embed) {\n\t\t\t\tnodes.push(node)\n\t\t\t} else {\n\t\t\t\tnodes.push(filterTextNode(node, model, allowedNodeTypes))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nodes as Field\n}\n"],"names":[],"mappings":";;AAmBA,MAAM,sBAAsB,CAC3B,UACwB;;AACxB,QAAM,mBAAwC,CAAA;AAE9C,MAAI,MAAM,QAAQ;AACjB,QAAI,WAAW,MAAM,UAAU,MAAM,OAAO,OAAO;AAClD,uBAAiB,KAChB,GAAI,MAAM,OAAO,MAAM,MAAM,GAAG,CAAyB;AAAA,IAAA,WAEhD,YAAY,MAAM,UAAU,MAAM,OAAO,QAAQ;AAC3D,uBAAiB,KAChB,GAAI,MAAM,OAAO,OAAO,MAAM,GAAG,CAAyB;AAAA,IAE5D;AAEI,SAAA,WAAM,OAAO,WAAb,mBAAqB,QAAQ;AAChC,uBAAiB,KAAK,OAAO;AAAA,IAC9B;AAAA,EACD;AAEO,SAAA;AACR;AAUA,MAAM,kBAAkB,CACvB,MACA,UACgB;;AAEf,MAAA,GAAC,WAAM,WAAN,mBAAc,uBACf,UAAK,WAAL,mBAAa,eAAc,SAAS,KACnC;AACM,WAAA;AAAA,MACN,GAAG;AAAA,MACH,QAAQ;AAAA,QACP,GAAG,KAAK;AAAA,QACR,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEH;AAEO,SAAA;AACR;AAWA,MAAM,iBAAiB,CACtB,MACA,OACA,qBACe;;AACf,QAAM,eAA2B;AAAA,IAChC,GAAG;AAAA,IACH,OAAO,CAAE;AAAA,EAAA;AAGV,WAAS,IAAI,GAAG,IAAI,KAAK,MAAM,QAAQ,KAAK;AACrC,UAAA,OAAO,KAAK,MAAM,CAAC;AAEzB,QAAI,iBAAiB,SAAS,KAAK,IAAI,GAAG;AACrC,UAAA,KAAK,SAAS,iBAAiB,WAAW;AAE5C,YAAA,GAAC,WAAM,WAAN,mBAAc,qBACf,KAAK,KAAK,cAAc,SAAS,KAChC;AACD,uBAAa,MAAM,KAAK;AAAA,YACvB,GAAG;AAAA,YACH,MAAM;AAAA,cACL,GAAG,KAAK;AAAA,cACR,QAAQ;AAAA,YACR;AAAA,UAAA,CACD;AAAA,QAAA,OACK;AACO,uBAAA,MAAM,KAAK,IAAI;AAAA,QAC7B;AAAA,MACU,WAAA,KAAK,SAAS,iBAAiB,OAAO;AAChD,aAAI,iBAAM,WAAN,mBAAc,WAAd,mBAAsB,SAAS,KAAK,KAAK,QAAQ;AACvC,uBAAA,MAAM,KAAK,IAAI;AAAA,QAC7B;AAAA,MAAA,OACM;AACO,qBAAA,MAAM,KAAK,IAAI;AAAA,MAC7B;AAAA,IACD;AAAA,EACD;AAEO,SAAA;AACR;AAUa,MAAA,sBAAsB,CAClC,eACA,UACU;AACV,QAAM,QAAkB,CAAA;AAElB,QAAA,mBAAmB,oBAAoB,KAAK;AAElD;AAAA,QACK,IAAI;AAAA;AAAA,IAER,KAAK,MAAM,UAAU,WAAW,MAAM,SAAS,cAAc,SAAS;AAAA,IACtE;AAAA,IACC;AACK,UAAA,OAAO,cAAc,CAAC;AAE5B,QAAI,iBAAiB,SAAS,KAAK,IAAI,GAAG;AACrC,UAAA,KAAK,SAAS,iBAAiB,OAAO;AACzC,cAAM,KAAK,gBAAgB,MAAM,KAAK,CAAC;AAAA,MAC7B,WAAA,KAAK,SAAS,iBAAiB,OAAO;AAChD,cAAM,KAAK,IAAI;AAAA,MAAA,OACT;AACN,cAAM,KAAK,eAAe,MAAM,OAAO,gBAAgB,CAAC;AAAA,MACzD;AAAA,IACD;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const embed = require("../types/value/embed.cjs");
|
|
4
|
-
const link = require("../types/value/link.cjs");
|
|
5
|
-
const PrismicRichTextSerializerError = require("../errors/PrismicRichTextSerializerError.cjs");
|
|
6
|
-
const index = require('./../_node_modules/hast-util-to-html/lib/index.cjs');
|
|
7
|
-
const serializeImage = (node) => {
|
|
8
|
-
var _a, _b, _c, _d, _e;
|
|
9
|
-
const src = (_a = node.properties) == null ? void 0 : _a.src;
|
|
10
|
-
if (!src) {
|
|
11
|
-
throw new PrismicRichTextSerializerError.PrismicRichTextSerializerError("Element of type `img` is missing an `src` attribute");
|
|
12
|
-
}
|
|
13
|
-
const url = new URL(src, "https://noop.com");
|
|
14
|
-
let width = (_b = node.properties) == null ? void 0 : _b.width;
|
|
15
|
-
let height = (_c = node.properties) == null ? void 0 : _c.height;
|
|
16
|
-
let x = 0;
|
|
17
|
-
let y = 0;
|
|
18
|
-
let zoom = 1;
|
|
19
|
-
if (url.hostname === "images.prismic.io") {
|
|
20
|
-
if (url.searchParams.has("w")) {
|
|
21
|
-
width = Number(url.searchParams.get("w"));
|
|
22
|
-
}
|
|
23
|
-
if (url.searchParams.has("h")) {
|
|
24
|
-
height = Number(url.searchParams.get("h"));
|
|
25
|
-
}
|
|
26
|
-
if (url.searchParams.has("rect")) {
|
|
27
|
-
const [rectX, rextY, rectW, _rectH] = url.searchParams.get("rect").split(",");
|
|
28
|
-
x = Number(rectX);
|
|
29
|
-
y = Number(rextY);
|
|
30
|
-
if (width) {
|
|
31
|
-
zoom = Math.max(1, width / Number(rectW));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
type: "image",
|
|
37
|
-
id: "",
|
|
38
|
-
url: src,
|
|
39
|
-
alt: ((_d = node.properties) == null ? void 0 : _d.alt) ?? "",
|
|
40
|
-
copyright: ((_e = node.properties) == null ? void 0 : _e.copyright) ?? null,
|
|
41
|
-
// This is not accurate. We're doing the casting because it seems the migration API
|
|
42
|
-
// accepts `undefined` values for those fields which is more convenient to us here.
|
|
43
|
-
// See: https://github.com/prismicio/prismic-client/pull/342#discussion_r1683650185
|
|
44
|
-
dimensions: { width, height },
|
|
45
|
-
edit: { x, y, zoom, background: "transparent" }
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const serializeEmbed = (node) => {
|
|
49
|
-
var _a, _b, _c, _d;
|
|
50
|
-
const src = (_a = node.properties) == null ? void 0 : _a.src;
|
|
51
|
-
if (!src) {
|
|
52
|
-
throw new PrismicRichTextSerializerError.PrismicRichTextSerializerError("Element of type `embed` is missing an `src` attribute");
|
|
53
|
-
}
|
|
54
|
-
const oembedBase = {
|
|
55
|
-
version: "1.0",
|
|
56
|
-
embed_url: src,
|
|
57
|
-
html: index.toHtml(node),
|
|
58
|
-
title: (_b = node.properties) == null ? void 0 : _b.title
|
|
59
|
-
};
|
|
60
|
-
const width = (_c = node.properties) == null ? void 0 : _c.width;
|
|
61
|
-
const height = (_d = node.properties) == null ? void 0 : _d.height;
|
|
62
|
-
node.children = [];
|
|
63
|
-
if (width && height) {
|
|
64
|
-
return {
|
|
65
|
-
type: "embed",
|
|
66
|
-
oembed: { ...oembedBase, type: embed.OEmbedType.Rich, width, height }
|
|
67
|
-
};
|
|
68
|
-
} else {
|
|
69
|
-
return {
|
|
70
|
-
type: "embed",
|
|
71
|
-
oembed: { ...oembedBase, type: embed.OEmbedType.Link }
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const serializeSpan = (node, rtPartialInlineNode) => {
|
|
76
|
-
var _a, _b;
|
|
77
|
-
if (rtPartialInlineNode.type === "hyperlink" && !("data" in rtPartialInlineNode)) {
|
|
78
|
-
const url = (_a = node.properties) == null ? void 0 : _a.href;
|
|
79
|
-
if (!url) {
|
|
80
|
-
throw new PrismicRichTextSerializerError.PrismicRichTextSerializerError("Element of type `hyperlink` is missing an `href` attribute");
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
type: "hyperlink",
|
|
84
|
-
data: {
|
|
85
|
-
link_type: link.LinkType.Web,
|
|
86
|
-
url,
|
|
87
|
-
target: (_b = node.properties) == null ? void 0 : _b.target
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return rtPartialInlineNode;
|
|
92
|
-
};
|
|
93
|
-
exports.serializeEmbed = serializeEmbed;
|
|
94
|
-
exports.serializeImage = serializeImage;
|
|
95
|
-
exports.serializeSpan = serializeSpan;
|
|
96
|
-
//# sourceMappingURL=hastSerializerHelpers.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hastSerializerHelpers.cjs","sources":["../../../src/lib/hastSerializerHelpers.ts"],"sourcesContent":["import type { Element } from \"hast\"\nimport { toHtml } from \"hast-util-to-html\"\n\nimport { OEmbedType } from \"../types/value/embed\"\nimport { LinkType } from \"../types/value/link\"\nimport type {\n\tRTEmbedNode,\n\tRTImageNode,\n\tRTLinkNode,\n} from \"../types/value/richText\"\n\nimport { PrismicRichTextSerializerError } from \"../errors/PrismicRichTextSerializerError\"\n\nimport type { RTPartialInlineNode } from \"./RichTextFieldBuilder\"\n\n/**\n * Serializes a hast {@link Element} node to a {@link RTImageNode}.\n *\n * @param node - A hast node to serialize.\n *\n * @returns Equivalent {@link RTImageNode}.\n */\nexport const serializeImage = (node: Element): RTImageNode => {\n\tconst src = node.properties?.src as string | undefined\n\n\tif (!src) {\n\t\tthrow new PrismicRichTextSerializerError(\n\t\t\t\"Element of type `img` is missing an `src` attribute\",\n\t\t)\n\t}\n\n\tconst url = new URL(src, \"https://noop.com\")\n\n\tlet width = node.properties?.width as number | undefined\n\tlet height = node.properties?.height as number | undefined\n\tlet x = 0\n\tlet y = 0\n\tlet zoom = 1\n\n\t// Attempt to infer the image dimensions from the URL imgix parameters.\n\tif (url.hostname === \"images.prismic.io\") {\n\t\tif (url.searchParams.has(\"w\")) {\n\t\t\twidth = Number(url.searchParams.get(\"w\"))\n\t\t}\n\n\t\tif (url.searchParams.has(\"h\")) {\n\t\t\theight = Number(url.searchParams.get(\"h\"))\n\t\t}\n\n\t\tif (url.searchParams.has(\"rect\")) {\n\t\t\tconst [rectX, rextY, rectW, _rectH] = url.searchParams\n\t\t\t\t.get(\"rect\")!\n\t\t\t\t.split(\",\")\n\n\t\t\tx = Number(rectX)\n\t\t\ty = Number(rextY)\n\n\t\t\t// This is not perfect but it's supposed to work on images without constraints.\n\t\t\tif (width) {\n\t\t\t\tzoom = Math.max(1, width / Number(rectW))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\ttype: \"image\",\n\t\tid: \"\",\n\t\turl: src,\n\t\talt: (node.properties?.alt as string) ?? \"\",\n\t\tcopyright: (node.properties?.copyright as string) ?? null,\n\t\t// This is not accurate. We're doing the casting because it seems the migration API\n\t\t// accepts `undefined` values for those fields which is more convenient to us here.\n\t\t// See: https://github.com/prismicio/prismic-client/pull/342#discussion_r1683650185\n\t\tdimensions: { width: width as number, height: height as number },\n\t\tedit: { x, y, zoom, background: \"transparent\" },\n\t}\n}\n\n/**\n * Serializes a hast {@link Element} node to a {@link RTEmbedNode}.\n *\n * @param node - A hast node to serialize.\n *\n * @returns Equivalent {@link RTEmbedNode}.\n */\nexport const serializeEmbed = (node: Element): RTEmbedNode => {\n\tconst src = node.properties?.src as string | undefined\n\n\tif (!src) {\n\t\tthrow new PrismicRichTextSerializerError(\n\t\t\t\"Element of type `embed` is missing an `src` attribute\",\n\t\t)\n\t}\n\n\tconst oembedBase = {\n\t\tversion: \"1.0\",\n\t\tembed_url: src,\n\t\thtml: toHtml(node),\n\t\ttitle: node.properties?.title as string | undefined,\n\t}\n\n\tconst width = node.properties?.width as number | undefined\n\tconst height = node.properties?.height as number | undefined\n\n\t// Remove the children of the embed node as we don't want to process them.\n\tnode.children = []\n\n\tif (width && height) {\n\t\treturn {\n\t\t\ttype: \"embed\",\n\t\t\toembed: { ...oembedBase, type: OEmbedType.Rich, width, height },\n\t\t}\n\t} else {\n\t\treturn {\n\t\t\ttype: \"embed\",\n\t\t\toembed: { ...oembedBase, type: OEmbedType.Link },\n\t\t}\n\t}\n}\n\n/**\n * Serializes a hast {@link Element} node to a {@link RTPartialInlineNode}.\n *\n * @param node - A hast node to serialize.\n * @param rtPartialInlineNode - A partial rich text node.\n *\n * @returns Equivalent {@link RTPartialInlineNode}.\n */\nexport const serializeSpan = (\n\tnode: Element,\n\trtPartialInlineNode:\n\t\t| RTPartialInlineNode\n\t\t| Omit<RTLinkNode, \"start\" | \"end\" | \"data\">,\n): RTPartialInlineNode => {\n\tif (\n\t\trtPartialInlineNode.type === \"hyperlink\" &&\n\t\t!(\"data\" in rtPartialInlineNode)\n\t) {\n\t\tconst url = node.properties?.href as string | undefined\n\t\tif (!url) {\n\t\t\tthrow new PrismicRichTextSerializerError(\n\t\t\t\t\"Element of type `hyperlink` is missing an `href` attribute\",\n\t\t\t)\n\t\t}\n\n\t\treturn {\n\t\t\ttype: \"hyperlink\",\n\t\t\tdata: {\n\t\t\t\tlink_type: LinkType.Web,\n\t\t\t\turl,\n\t\t\t\ttarget: node.properties?.target as string | undefined,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn rtPartialInlineNode\n}\n"],"names":["PrismicRichTextSerializerError","toHtml","OEmbedType","LinkType"],"mappings":";;;;;;AAsBa,MAAA,iBAAiB,CAAC,SAA8B;;AACtD,QAAA,OAAM,UAAK,eAAL,mBAAiB;AAE7B,MAAI,CAAC,KAAK;AACH,UAAA,IAAIA,+BAAAA,+BACT,qDAAqD;AAAA,EAEvD;AAEA,QAAM,MAAM,IAAI,IAAI,KAAK,kBAAkB;AAEvC,MAAA,SAAQ,UAAK,eAAL,mBAAiB;AACzB,MAAA,UAAS,UAAK,eAAL,mBAAiB;AAC9B,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,OAAO;AAGP,MAAA,IAAI,aAAa,qBAAqB;AACzC,QAAI,IAAI,aAAa,IAAI,GAAG,GAAG;AAC9B,cAAQ,OAAO,IAAI,aAAa,IAAI,GAAG,CAAC;AAAA,IACzC;AAEA,QAAI,IAAI,aAAa,IAAI,GAAG,GAAG;AAC9B,eAAS,OAAO,IAAI,aAAa,IAAI,GAAG,CAAC;AAAA,IAC1C;AAEA,QAAI,IAAI,aAAa,IAAI,MAAM,GAAG;AACjC,YAAM,CAAC,OAAO,OAAO,OAAO,MAAM,IAAI,IAAI,aACxC,IAAI,MAAM,EACV,MAAM,GAAG;AAEX,UAAI,OAAO,KAAK;AAChB,UAAI,OAAO,KAAK;AAGhB,UAAI,OAAO;AACV,eAAO,KAAK,IAAI,GAAG,QAAQ,OAAO,KAAK,CAAC;AAAA,MACzC;AAAA,IACD;AAAA,EACD;AAEO,SAAA;AAAA,IACN,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,OAAM,UAAK,eAAL,mBAAiB,QAAkB;AAAA,IACzC,aAAY,UAAK,eAAL,mBAAiB,cAAwB;AAAA;AAAA;AAAA;AAAA,IAIrD,YAAY,EAAE,OAAwB,OAA0B;AAAA,IAChE,MAAM,EAAE,GAAG,GAAG,MAAM,YAAY,cAAe;AAAA,EAAA;AAEjD;AASa,MAAA,iBAAiB,CAAC,SAA8B;;AACtD,QAAA,OAAM,UAAK,eAAL,mBAAiB;AAE7B,MAAI,CAAC,KAAK;AACH,UAAA,IAAIA,+BAAAA,+BACT,uDAAuD;AAAA,EAEzD;AAEA,QAAM,aAAa;AAAA,IAClB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,MAAMC,aAAO,IAAI;AAAA,IACjB,QAAO,UAAK,eAAL,mBAAiB;AAAA,EAAA;AAGnB,QAAA,SAAQ,UAAK,eAAL,mBAAiB;AACzB,QAAA,UAAS,UAAK,eAAL,mBAAiB;AAGhC,OAAK,WAAW;AAEhB,MAAI,SAAS,QAAQ;AACb,WAAA;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,EAAE,GAAG,YAAY,MAAMC,MAAAA,WAAW,MAAM,OAAO,OAAQ;AAAA,IAAA;AAAA,SAE1D;AACC,WAAA;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,EAAE,GAAG,YAAY,MAAMA,MAAAA,WAAW,KAAM;AAAA,IAAA;AAAA,EAElD;AACD;AAUa,MAAA,gBAAgB,CAC5B,MACA,wBAGwB;;AACxB,MACC,oBAAoB,SAAS,eAC7B,EAAE,UAAU,sBACX;AACK,UAAA,OAAM,UAAK,eAAL,mBAAiB;AAC7B,QAAI,CAAC,KAAK;AACH,YAAA,IAAIF,+BAAAA,+BACT,4DAA4D;AAAA,IAE9D;AAEO,WAAA;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,QACL,WAAWG,KAAS,SAAA;AAAA,QACpB;AAAA,QACA,SAAQ,UAAK,eAAL,mBAAiB;AAAA,MACzB;AAAA,IAAA;AAAA,EAEH;AAEO,SAAA;AACR;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Element } from "hast";
|
|
2
|
-
import type { RTEmbedNode, RTImageNode, RTLinkNode } from "../types/value/richText";
|
|
3
|
-
import type { RTPartialInlineNode } from "./RichTextFieldBuilder";
|
|
4
|
-
/**
|
|
5
|
-
* Serializes a hast {@link Element} node to a {@link RTImageNode}.
|
|
6
|
-
*
|
|
7
|
-
* @param node - A hast node to serialize.
|
|
8
|
-
*
|
|
9
|
-
* @returns Equivalent {@link RTImageNode}.
|
|
10
|
-
*/
|
|
11
|
-
export declare const serializeImage: (node: Element) => RTImageNode;
|
|
12
|
-
/**
|
|
13
|
-
* Serializes a hast {@link Element} node to a {@link RTEmbedNode}.
|
|
14
|
-
*
|
|
15
|
-
* @param node - A hast node to serialize.
|
|
16
|
-
*
|
|
17
|
-
* @returns Equivalent {@link RTEmbedNode}.
|
|
18
|
-
*/
|
|
19
|
-
export declare const serializeEmbed: (node: Element) => RTEmbedNode;
|
|
20
|
-
/**
|
|
21
|
-
* Serializes a hast {@link Element} node to a {@link RTPartialInlineNode}.
|
|
22
|
-
*
|
|
23
|
-
* @param node - A hast node to serialize.
|
|
24
|
-
* @param rtPartialInlineNode - A partial rich text node.
|
|
25
|
-
*
|
|
26
|
-
* @returns Equivalent {@link RTPartialInlineNode}.
|
|
27
|
-
*/
|
|
28
|
-
export declare const serializeSpan: (node: Element, rtPartialInlineNode: RTPartialInlineNode | Omit<RTLinkNode, "start" | "end" | "data">) => RTPartialInlineNode;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { OEmbedType } from "../types/value/embed.js";
|
|
2
|
-
import { LinkType } from "../types/value/link.js";
|
|
3
|
-
import { PrismicRichTextSerializerError } from "../errors/PrismicRichTextSerializerError.js";
|
|
4
|
-
import { toHtml } from './../_node_modules/hast-util-to-html/lib/index.js';
|
|
5
|
-
const serializeImage = (node) => {
|
|
6
|
-
var _a, _b, _c, _d, _e;
|
|
7
|
-
const src = (_a = node.properties) == null ? void 0 : _a.src;
|
|
8
|
-
if (!src) {
|
|
9
|
-
throw new PrismicRichTextSerializerError("Element of type `img` is missing an `src` attribute");
|
|
10
|
-
}
|
|
11
|
-
const url = new URL(src, "https://noop.com");
|
|
12
|
-
let width = (_b = node.properties) == null ? void 0 : _b.width;
|
|
13
|
-
let height = (_c = node.properties) == null ? void 0 : _c.height;
|
|
14
|
-
let x = 0;
|
|
15
|
-
let y = 0;
|
|
16
|
-
let zoom = 1;
|
|
17
|
-
if (url.hostname === "images.prismic.io") {
|
|
18
|
-
if (url.searchParams.has("w")) {
|
|
19
|
-
width = Number(url.searchParams.get("w"));
|
|
20
|
-
}
|
|
21
|
-
if (url.searchParams.has("h")) {
|
|
22
|
-
height = Number(url.searchParams.get("h"));
|
|
23
|
-
}
|
|
24
|
-
if (url.searchParams.has("rect")) {
|
|
25
|
-
const [rectX, rextY, rectW, _rectH] = url.searchParams.get("rect").split(",");
|
|
26
|
-
x = Number(rectX);
|
|
27
|
-
y = Number(rextY);
|
|
28
|
-
if (width) {
|
|
29
|
-
zoom = Math.max(1, width / Number(rectW));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
type: "image",
|
|
35
|
-
id: "",
|
|
36
|
-
url: src,
|
|
37
|
-
alt: ((_d = node.properties) == null ? void 0 : _d.alt) ?? "",
|
|
38
|
-
copyright: ((_e = node.properties) == null ? void 0 : _e.copyright) ?? null,
|
|
39
|
-
// This is not accurate. We're doing the casting because it seems the migration API
|
|
40
|
-
// accepts `undefined` values for those fields which is more convenient to us here.
|
|
41
|
-
// See: https://github.com/prismicio/prismic-client/pull/342#discussion_r1683650185
|
|
42
|
-
dimensions: { width, height },
|
|
43
|
-
edit: { x, y, zoom, background: "transparent" }
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
const serializeEmbed = (node) => {
|
|
47
|
-
var _a, _b, _c, _d;
|
|
48
|
-
const src = (_a = node.properties) == null ? void 0 : _a.src;
|
|
49
|
-
if (!src) {
|
|
50
|
-
throw new PrismicRichTextSerializerError("Element of type `embed` is missing an `src` attribute");
|
|
51
|
-
}
|
|
52
|
-
const oembedBase = {
|
|
53
|
-
version: "1.0",
|
|
54
|
-
embed_url: src,
|
|
55
|
-
html: toHtml(node),
|
|
56
|
-
title: (_b = node.properties) == null ? void 0 : _b.title
|
|
57
|
-
};
|
|
58
|
-
const width = (_c = node.properties) == null ? void 0 : _c.width;
|
|
59
|
-
const height = (_d = node.properties) == null ? void 0 : _d.height;
|
|
60
|
-
node.children = [];
|
|
61
|
-
if (width && height) {
|
|
62
|
-
return {
|
|
63
|
-
type: "embed",
|
|
64
|
-
oembed: { ...oembedBase, type: OEmbedType.Rich, width, height }
|
|
65
|
-
};
|
|
66
|
-
} else {
|
|
67
|
-
return {
|
|
68
|
-
type: "embed",
|
|
69
|
-
oembed: { ...oembedBase, type: OEmbedType.Link }
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const serializeSpan = (node, rtPartialInlineNode) => {
|
|
74
|
-
var _a, _b;
|
|
75
|
-
if (rtPartialInlineNode.type === "hyperlink" && !("data" in rtPartialInlineNode)) {
|
|
76
|
-
const url = (_a = node.properties) == null ? void 0 : _a.href;
|
|
77
|
-
if (!url) {
|
|
78
|
-
throw new PrismicRichTextSerializerError("Element of type `hyperlink` is missing an `href` attribute");
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
type: "hyperlink",
|
|
82
|
-
data: {
|
|
83
|
-
link_type: LinkType.Web,
|
|
84
|
-
url,
|
|
85
|
-
target: (_b = node.properties) == null ? void 0 : _b.target
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
return rtPartialInlineNode;
|
|
90
|
-
};
|
|
91
|
-
export {
|
|
92
|
-
serializeEmbed,
|
|
93
|
-
serializeImage,
|
|
94
|
-
serializeSpan
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=hastSerializerHelpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hastSerializerHelpers.js","sources":["../../../src/lib/hastSerializerHelpers.ts"],"sourcesContent":["import type { Element } from \"hast\"\nimport { toHtml } from \"hast-util-to-html\"\n\nimport { OEmbedType } from \"../types/value/embed\"\nimport { LinkType } from \"../types/value/link\"\nimport type {\n\tRTEmbedNode,\n\tRTImageNode,\n\tRTLinkNode,\n} from \"../types/value/richText\"\n\nimport { PrismicRichTextSerializerError } from \"../errors/PrismicRichTextSerializerError\"\n\nimport type { RTPartialInlineNode } from \"./RichTextFieldBuilder\"\n\n/**\n * Serializes a hast {@link Element} node to a {@link RTImageNode}.\n *\n * @param node - A hast node to serialize.\n *\n * @returns Equivalent {@link RTImageNode}.\n */\nexport const serializeImage = (node: Element): RTImageNode => {\n\tconst src = node.properties?.src as string | undefined\n\n\tif (!src) {\n\t\tthrow new PrismicRichTextSerializerError(\n\t\t\t\"Element of type `img` is missing an `src` attribute\",\n\t\t)\n\t}\n\n\tconst url = new URL(src, \"https://noop.com\")\n\n\tlet width = node.properties?.width as number | undefined\n\tlet height = node.properties?.height as number | undefined\n\tlet x = 0\n\tlet y = 0\n\tlet zoom = 1\n\n\t// Attempt to infer the image dimensions from the URL imgix parameters.\n\tif (url.hostname === \"images.prismic.io\") {\n\t\tif (url.searchParams.has(\"w\")) {\n\t\t\twidth = Number(url.searchParams.get(\"w\"))\n\t\t}\n\n\t\tif (url.searchParams.has(\"h\")) {\n\t\t\theight = Number(url.searchParams.get(\"h\"))\n\t\t}\n\n\t\tif (url.searchParams.has(\"rect\")) {\n\t\t\tconst [rectX, rextY, rectW, _rectH] = url.searchParams\n\t\t\t\t.get(\"rect\")!\n\t\t\t\t.split(\",\")\n\n\t\t\tx = Number(rectX)\n\t\t\ty = Number(rextY)\n\n\t\t\t// This is not perfect but it's supposed to work on images without constraints.\n\t\t\tif (width) {\n\t\t\t\tzoom = Math.max(1, width / Number(rectW))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\ttype: \"image\",\n\t\tid: \"\",\n\t\turl: src,\n\t\talt: (node.properties?.alt as string) ?? \"\",\n\t\tcopyright: (node.properties?.copyright as string) ?? null,\n\t\t// This is not accurate. We're doing the casting because it seems the migration API\n\t\t// accepts `undefined` values for those fields which is more convenient to us here.\n\t\t// See: https://github.com/prismicio/prismic-client/pull/342#discussion_r1683650185\n\t\tdimensions: { width: width as number, height: height as number },\n\t\tedit: { x, y, zoom, background: \"transparent\" },\n\t}\n}\n\n/**\n * Serializes a hast {@link Element} node to a {@link RTEmbedNode}.\n *\n * @param node - A hast node to serialize.\n *\n * @returns Equivalent {@link RTEmbedNode}.\n */\nexport const serializeEmbed = (node: Element): RTEmbedNode => {\n\tconst src = node.properties?.src as string | undefined\n\n\tif (!src) {\n\t\tthrow new PrismicRichTextSerializerError(\n\t\t\t\"Element of type `embed` is missing an `src` attribute\",\n\t\t)\n\t}\n\n\tconst oembedBase = {\n\t\tversion: \"1.0\",\n\t\tembed_url: src,\n\t\thtml: toHtml(node),\n\t\ttitle: node.properties?.title as string | undefined,\n\t}\n\n\tconst width = node.properties?.width as number | undefined\n\tconst height = node.properties?.height as number | undefined\n\n\t// Remove the children of the embed node as we don't want to process them.\n\tnode.children = []\n\n\tif (width && height) {\n\t\treturn {\n\t\t\ttype: \"embed\",\n\t\t\toembed: { ...oembedBase, type: OEmbedType.Rich, width, height },\n\t\t}\n\t} else {\n\t\treturn {\n\t\t\ttype: \"embed\",\n\t\t\toembed: { ...oembedBase, type: OEmbedType.Link },\n\t\t}\n\t}\n}\n\n/**\n * Serializes a hast {@link Element} node to a {@link RTPartialInlineNode}.\n *\n * @param node - A hast node to serialize.\n * @param rtPartialInlineNode - A partial rich text node.\n *\n * @returns Equivalent {@link RTPartialInlineNode}.\n */\nexport const serializeSpan = (\n\tnode: Element,\n\trtPartialInlineNode:\n\t\t| RTPartialInlineNode\n\t\t| Omit<RTLinkNode, \"start\" | \"end\" | \"data\">,\n): RTPartialInlineNode => {\n\tif (\n\t\trtPartialInlineNode.type === \"hyperlink\" &&\n\t\t!(\"data\" in rtPartialInlineNode)\n\t) {\n\t\tconst url = node.properties?.href as string | undefined\n\t\tif (!url) {\n\t\t\tthrow new PrismicRichTextSerializerError(\n\t\t\t\t\"Element of type `hyperlink` is missing an `href` attribute\",\n\t\t\t)\n\t\t}\n\n\t\treturn {\n\t\t\ttype: \"hyperlink\",\n\t\t\tdata: {\n\t\t\t\tlink_type: LinkType.Web,\n\t\t\t\turl,\n\t\t\t\ttarget: node.properties?.target as string | undefined,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn rtPartialInlineNode\n}\n"],"names":[],"mappings":";;;;AAsBa,MAAA,iBAAiB,CAAC,SAA8B;;AACtD,QAAA,OAAM,UAAK,eAAL,mBAAiB;AAE7B,MAAI,CAAC,KAAK;AACH,UAAA,IAAI,+BACT,qDAAqD;AAAA,EAEvD;AAEA,QAAM,MAAM,IAAI,IAAI,KAAK,kBAAkB;AAEvC,MAAA,SAAQ,UAAK,eAAL,mBAAiB;AACzB,MAAA,UAAS,UAAK,eAAL,mBAAiB;AAC9B,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,OAAO;AAGP,MAAA,IAAI,aAAa,qBAAqB;AACzC,QAAI,IAAI,aAAa,IAAI,GAAG,GAAG;AAC9B,cAAQ,OAAO,IAAI,aAAa,IAAI,GAAG,CAAC;AAAA,IACzC;AAEA,QAAI,IAAI,aAAa,IAAI,GAAG,GAAG;AAC9B,eAAS,OAAO,IAAI,aAAa,IAAI,GAAG,CAAC;AAAA,IAC1C;AAEA,QAAI,IAAI,aAAa,IAAI,MAAM,GAAG;AACjC,YAAM,CAAC,OAAO,OAAO,OAAO,MAAM,IAAI,IAAI,aACxC,IAAI,MAAM,EACV,MAAM,GAAG;AAEX,UAAI,OAAO,KAAK;AAChB,UAAI,OAAO,KAAK;AAGhB,UAAI,OAAO;AACV,eAAO,KAAK,IAAI,GAAG,QAAQ,OAAO,KAAK,CAAC;AAAA,MACzC;AAAA,IACD;AAAA,EACD;AAEO,SAAA;AAAA,IACN,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,OAAM,UAAK,eAAL,mBAAiB,QAAkB;AAAA,IACzC,aAAY,UAAK,eAAL,mBAAiB,cAAwB;AAAA;AAAA;AAAA;AAAA,IAIrD,YAAY,EAAE,OAAwB,OAA0B;AAAA,IAChE,MAAM,EAAE,GAAG,GAAG,MAAM,YAAY,cAAe;AAAA,EAAA;AAEjD;AASa,MAAA,iBAAiB,CAAC,SAA8B;;AACtD,QAAA,OAAM,UAAK,eAAL,mBAAiB;AAE7B,MAAI,CAAC,KAAK;AACH,UAAA,IAAI,+BACT,uDAAuD;AAAA,EAEzD;AAEA,QAAM,aAAa;AAAA,IAClB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,MAAM,OAAO,IAAI;AAAA,IACjB,QAAO,UAAK,eAAL,mBAAiB;AAAA,EAAA;AAGnB,QAAA,SAAQ,UAAK,eAAL,mBAAiB;AACzB,QAAA,UAAS,UAAK,eAAL,mBAAiB;AAGhC,OAAK,WAAW;AAEhB,MAAI,SAAS,QAAQ;AACb,WAAA;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,EAAE,GAAG,YAAY,MAAM,WAAW,MAAM,OAAO,OAAQ;AAAA,IAAA;AAAA,SAE1D;AACC,WAAA;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,EAAE,GAAG,YAAY,MAAM,WAAW,KAAM;AAAA,IAAA;AAAA,EAElD;AACD;AAUa,MAAA,gBAAgB,CAC5B,MACA,wBAGwB;;AACxB,MACC,oBAAoB,SAAS,eAC7B,EAAE,UAAU,sBACX;AACK,UAAA,OAAM,UAAK,eAAL,mBAAiB;AAC7B,QAAI,CAAC,KAAK;AACH,YAAA,IAAI,+BACT,4DAA4D;AAAA,IAE9D;AAEO,WAAA;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,QACL,WAAW,SAAS;AAAA,QACpB;AAAA,QACA,SAAQ,UAAK,eAAL,mBAAiB;AAAA,MACzB;AAAA,IAAA;AAAA,EAEH;AAEO,SAAA;AACR;"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const richText = require("../types/value/richText.cjs");
|
|
4
|
-
const PrismicRichTextSerializerError = require("../errors/PrismicRichTextSerializerError.cjs");
|
|
5
|
-
const RichTextFieldBuilder = require("./RichTextFieldBuilder.cjs");
|
|
6
|
-
const hastSerializerHelpers = require("./hastSerializerHelpers.cjs");
|
|
7
|
-
const index = require('./../_node_modules/unist-util-visit/lib/index.cjs');
|
|
8
|
-
const index$1 = require('./../_node_modules/hast-util-to-string/lib/index.cjs');
|
|
9
|
-
const DEFAULT_SERIALIZER = {
|
|
10
|
-
h1: "heading1",
|
|
11
|
-
h2: "heading2",
|
|
12
|
-
h3: "heading3",
|
|
13
|
-
h4: "heading4",
|
|
14
|
-
h5: "heading5",
|
|
15
|
-
h6: "heading6",
|
|
16
|
-
p: "paragraph",
|
|
17
|
-
pre: "preformatted",
|
|
18
|
-
strong: "strong",
|
|
19
|
-
em: "em",
|
|
20
|
-
li: ({ context }) => context.listType === "group-o-list-item" ? "o-list-item" : "list-item",
|
|
21
|
-
ul: "group-list-item",
|
|
22
|
-
ol: "group-o-list-item",
|
|
23
|
-
img: "image",
|
|
24
|
-
iframe: "embed",
|
|
25
|
-
a: "hyperlink"
|
|
26
|
-
};
|
|
27
|
-
const VFILE_RULE = "failed-to-serialize-node";
|
|
28
|
-
const VFILE_SOURCE = "prismic";
|
|
29
|
-
const hastToRichText = (tree, file, config) => {
|
|
30
|
-
const builder = new RichTextFieldBuilder.RichTextFieldBuilder();
|
|
31
|
-
const serializer = {
|
|
32
|
-
...DEFAULT_SERIALIZER,
|
|
33
|
-
...config == null ? void 0 : config.serializer
|
|
34
|
-
};
|
|
35
|
-
let lastRTTextNodeType = richText.RichTextNodeType.paragraph;
|
|
36
|
-
let lastListType = void 0;
|
|
37
|
-
index.visit(tree, (node) => {
|
|
38
|
-
if (node.type === "element") {
|
|
39
|
-
if (node.tagName === "br") {
|
|
40
|
-
try {
|
|
41
|
-
builder.appendText("\n");
|
|
42
|
-
} catch (error) {
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
let serializerOrShorthand;
|
|
46
|
-
if (node.matchesSerializer && node.matchesSerializer in serializer) {
|
|
47
|
-
serializerOrShorthand = serializer[node.matchesSerializer];
|
|
48
|
-
} else if (node.tagName in serializer) {
|
|
49
|
-
serializerOrShorthand = serializer[node.tagName];
|
|
50
|
-
} else {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
let shorthand;
|
|
54
|
-
if (typeof serializerOrShorthand === "function") {
|
|
55
|
-
const shorthandOrNode = serializerOrShorthand({
|
|
56
|
-
node,
|
|
57
|
-
context: { listType: lastListType }
|
|
58
|
-
});
|
|
59
|
-
if (!shorthandOrNode) {
|
|
60
|
-
return;
|
|
61
|
-
} else if (typeof shorthandOrNode === "object" && "type" in shorthandOrNode) {
|
|
62
|
-
switch (shorthandOrNode.type) {
|
|
63
|
-
case richText.RichTextNodeType.strong:
|
|
64
|
-
case richText.RichTextNodeType.em:
|
|
65
|
-
case richText.RichTextNodeType.label:
|
|
66
|
-
case richText.RichTextNodeType.hyperlink: {
|
|
67
|
-
const length = index$1.toString(node).trimEnd().length;
|
|
68
|
-
try {
|
|
69
|
-
builder.appendSpan(shorthandOrNode, length);
|
|
70
|
-
} catch (error) {
|
|
71
|
-
builder.appendTextNode(lastRTTextNodeType, config == null ? void 0 : config.direction);
|
|
72
|
-
builder.appendSpan(shorthandOrNode, length);
|
|
73
|
-
}
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
case richText.RichTextNodeType.image:
|
|
77
|
-
case richText.RichTextNodeType.embed:
|
|
78
|
-
builder.appendNode(shorthandOrNode);
|
|
79
|
-
return;
|
|
80
|
-
default:
|
|
81
|
-
lastRTTextNodeType = shorthandOrNode.type;
|
|
82
|
-
builder.appendNode(shorthandOrNode);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
shorthand = shorthandOrNode;
|
|
87
|
-
} else {
|
|
88
|
-
shorthand = serializerOrShorthand;
|
|
89
|
-
}
|
|
90
|
-
let match;
|
|
91
|
-
if (typeof shorthand === "string") {
|
|
92
|
-
match = { type: shorthand };
|
|
93
|
-
} else {
|
|
94
|
-
match = { type: richText.RichTextNodeType.label, data: shorthand };
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
switch (match.type) {
|
|
98
|
-
case richText.RichTextNodeType.heading1:
|
|
99
|
-
case richText.RichTextNodeType.heading2:
|
|
100
|
-
case richText.RichTextNodeType.heading3:
|
|
101
|
-
case richText.RichTextNodeType.heading4:
|
|
102
|
-
case richText.RichTextNodeType.heading5:
|
|
103
|
-
case richText.RichTextNodeType.heading6:
|
|
104
|
-
case richText.RichTextNodeType.paragraph:
|
|
105
|
-
case richText.RichTextNodeType.preformatted:
|
|
106
|
-
case richText.RichTextNodeType.listItem:
|
|
107
|
-
case richText.RichTextNodeType.oListItem:
|
|
108
|
-
lastRTTextNodeType = match.type;
|
|
109
|
-
builder.appendTextNode(match.type, config == null ? void 0 : config.direction);
|
|
110
|
-
break;
|
|
111
|
-
case richText.RichTextNodeType.list:
|
|
112
|
-
case richText.RichTextNodeType.oList:
|
|
113
|
-
lastListType = match.type;
|
|
114
|
-
break;
|
|
115
|
-
case richText.RichTextNodeType.image:
|
|
116
|
-
builder.appendNode(hastSerializerHelpers.serializeImage(node));
|
|
117
|
-
break;
|
|
118
|
-
case richText.RichTextNodeType.embed:
|
|
119
|
-
builder.appendNode(hastSerializerHelpers.serializeEmbed(node));
|
|
120
|
-
break;
|
|
121
|
-
case richText.RichTextNodeType.strong:
|
|
122
|
-
case richText.RichTextNodeType.em:
|
|
123
|
-
case richText.RichTextNodeType.label:
|
|
124
|
-
case richText.RichTextNodeType.hyperlink: {
|
|
125
|
-
const span = hastSerializerHelpers.serializeSpan(node, match);
|
|
126
|
-
const length = index$1.toString(node).trimEnd().length;
|
|
127
|
-
try {
|
|
128
|
-
builder.appendSpan(span, length);
|
|
129
|
-
} catch (error) {
|
|
130
|
-
builder.appendTextNode(lastRTTextNodeType, config == null ? void 0 : config.direction);
|
|
131
|
-
builder.appendSpan(span, length);
|
|
132
|
-
}
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
default:
|
|
136
|
-
throw new Error(`Unknown rich text node type: \`${match.type}\``);
|
|
137
|
-
}
|
|
138
|
-
} catch (error) {
|
|
139
|
-
if (error instanceof PrismicRichTextSerializerError.PrismicRichTextSerializerError) {
|
|
140
|
-
file.message(error.message, {
|
|
141
|
-
cause: error,
|
|
142
|
-
place: node.position,
|
|
143
|
-
ruleId: VFILE_RULE,
|
|
144
|
-
source: VFILE_SOURCE
|
|
145
|
-
});
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
throw error;
|
|
149
|
-
}
|
|
150
|
-
} else if (node.type === "text") {
|
|
151
|
-
if (!(node.value.replace(/[ \t\n\f\r]/g, "") === "")) {
|
|
152
|
-
try {
|
|
153
|
-
builder.appendText(node.value);
|
|
154
|
-
} catch (error) {
|
|
155
|
-
builder.appendTextNode(lastRTTextNodeType, config == null ? void 0 : config.direction);
|
|
156
|
-
builder.appendText(node.value);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
return builder.build();
|
|
162
|
-
};
|
|
163
|
-
exports.hastToRichText = hastToRichText;
|
|
164
|
-
//# sourceMappingURL=hastToRichText.cjs.map
|