@embedpdf/react 3.0.0-next.14 → 3.0.0-next.16
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/AnnotationList-DcyhF2kU-CiBFOq1z.d.cts +878 -0
- package/dist/AnnotationList-DcyhF2kU-CiBFOq1z.d.ts +878 -0
- package/dist/actions.cjs +25 -5
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +18 -5
- package/dist/actions.d.ts +18 -5
- package/dist/actions.js +22 -6
- package/dist/actions.js.map +1 -1
- package/dist/anchored-DeX95xSd.d.ts +85 -0
- package/dist/anchored-DzN3JywS.d.cts +85 -0
- package/dist/anchored.cjs +71 -28
- package/dist/anchored.cjs.map +1 -1
- package/dist/anchored.d.cts +2 -45
- package/dist/anchored.d.ts +2 -45
- package/dist/anchored.js +56 -19
- package/dist/anchored.js.map +1 -1
- package/dist/annotation-3UvABfJm.d.cts +305 -0
- package/dist/annotation-BNHQpMKv.cjs +806 -0
- package/dist/annotation-BNHQpMKv.cjs.map +1 -0
- package/dist/annotation-CDI8CFb3.js +684 -0
- package/dist/annotation-CDI8CFb3.js.map +1 -0
- package/dist/annotation-DhEfs0pH.d.ts +305 -0
- package/dist/annotation.cjs +20 -784
- package/dist/annotation.d.cts +2 -2
- package/dist/annotation.d.ts +2 -2
- package/dist/annotation.js +2 -769
- package/dist/attachment.cjs +39 -0
- package/dist/attachment.cjs.map +1 -0
- package/dist/attachment.d.cts +29 -0
- package/dist/attachment.d.ts +29 -0
- package/dist/attachment.js +28 -0
- package/dist/attachment.js.map +1 -0
- package/dist/commands.cjs +68 -28
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.d.cts +37 -10
- package/dist/commands.d.ts +37 -10
- package/dist/commands.js +68 -31
- package/dist/commands.js.map +1 -1
- package/dist/form-BSGvjA5D.js +511 -0
- package/dist/form-BSGvjA5D.js.map +1 -0
- package/dist/form-BgztZyOK.cjs +548 -0
- package/dist/form-BgztZyOK.cjs.map +1 -0
- package/dist/form.cjs +5 -5
- package/dist/form.d.cts +41 -2
- package/dist/form.d.ts +41 -2
- package/dist/form.js +2 -3
- package/dist/history.cjs +38 -0
- package/dist/history.cjs.map +1 -0
- package/dist/history.d.cts +27 -0
- package/dist/history.d.ts +27 -0
- package/dist/history.js +27 -0
- package/dist/history.js.map +1 -0
- package/dist/i18n.cjs +26 -30
- package/dist/i18n.cjs.map +1 -1
- package/dist/i18n.d.cts +24 -21
- package/dist/i18n.d.ts +24 -21
- package/dist/i18n.js +24 -31
- package/dist/i18n.js.map +1 -1
- package/dist/index.cjs +227 -57
- package/dist/index.d.cts +35 -32
- package/dist/index.d.ts +35 -32
- package/dist/index.js +36 -30
- package/dist/inert-CmBEbKCn.cjs +19 -0
- package/dist/inert-CmBEbKCn.cjs.map +1 -0
- package/dist/inert-D8fkennb.js +14 -0
- package/dist/inert-D8fkennb.js.map +1 -0
- package/dist/interaction.cjs +48 -102
- package/dist/interaction.cjs.map +1 -1
- package/dist/interaction.d.cts +23 -32
- package/dist/interaction.d.ts +23 -32
- package/dist/interaction.js +33 -102
- package/dist/interaction.js.map +1 -1
- package/dist/link.cjs +65 -104
- package/dist/link.cjs.map +1 -1
- package/dist/link.d.cts +21 -16
- package/dist/link.d.ts +22 -17
- package/dist/link.js +67 -107
- package/dist/link.js.map +1 -1
- package/dist/measurement.cjs +36 -11
- package/dist/measurement.cjs.map +1 -1
- package/dist/measurement.d.cts +33 -7
- package/dist/measurement.d.ts +33 -7
- package/dist/measurement.js +35 -14
- package/dist/measurement.js.map +1 -1
- package/dist/metadata.cjs +20 -7
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.d.cts +22 -7
- package/dist/metadata.d.ts +22 -7
- package/dist/metadata.js +20 -10
- package/dist/metadata.js.map +1 -1
- package/dist/outline.cjs +39 -0
- package/dist/outline.cjs.map +1 -0
- package/dist/outline.d.cts +31 -0
- package/dist/outline.d.ts +31 -0
- package/dist/outline.js +28 -0
- package/dist/outline.js.map +1 -0
- package/dist/page-edit.cjs +15 -3
- package/dist/page-edit.cjs.map +1 -1
- package/dist/page-edit.d.cts +17 -2
- package/dist/page-edit.d.ts +17 -2
- package/dist/page-edit.js +15 -5
- package/dist/page-edit.js.map +1 -1
- package/dist/page-layers-Bkaaz8Zf.js +26 -0
- package/dist/page-layers-Bkaaz8Zf.js.map +1 -0
- package/dist/page-layers-BloZDoOV.cjs +37 -0
- package/dist/page-layers-BloZDoOV.cjs.map +1 -0
- package/dist/page-view.cjs +89 -82
- package/dist/page-view.cjs.map +1 -1
- package/dist/page-view.d.cts +14 -7
- package/dist/page-view.d.ts +18 -11
- package/dist/page-view.js +86 -81
- package/dist/page-view.js.map +1 -1
- package/dist/redaction.cjs +30 -15
- package/dist/redaction.cjs.map +1 -1
- package/dist/redaction.d.cts +27 -9
- package/dist/redaction.d.ts +27 -9
- package/dist/redaction.js +29 -18
- package/dist/redaction.js.map +1 -1
- package/dist/render.cjs +71 -46
- package/dist/render.cjs.map +1 -1
- package/dist/render.d.cts +17 -5
- package/dist/render.d.ts +17 -5
- package/dist/render.js +70 -49
- package/dist/render.js.map +1 -1
- package/dist/runtime-BfnpyfY0.cjs +556 -0
- package/dist/runtime-BfnpyfY0.cjs.map +1 -0
- package/dist/runtime-DBEBlpQV.d.cts +237 -0
- package/dist/runtime-V3MVMb91.d.ts +237 -0
- package/dist/runtime-tD5iJU83.js +399 -0
- package/dist/runtime-tD5iJU83.js.map +1 -0
- package/dist/runtime.cjs +45 -324
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +2 -306
- package/dist/search.cjs +81 -50
- package/dist/search.cjs.map +1 -1
- package/dist/search.d.cts +37 -24
- package/dist/search.d.ts +37 -24
- package/dist/search.js +81 -53
- package/dist/search.js.map +1 -1
- package/dist/selection.cjs +105 -108
- package/dist/selection.cjs.map +1 -1
- package/dist/selection.d.cts +54 -26
- package/dist/selection.d.ts +56 -28
- package/dist/selection.js +103 -110
- package/dist/selection.js.map +1 -1
- package/dist/shell.cjs +36 -21
- package/dist/shell.cjs.map +1 -1
- package/dist/shell.d.cts +32 -17
- package/dist/shell.d.ts +32 -17
- package/dist/shell.js +36 -24
- package/dist/shell.js.map +1 -1
- package/dist/signature.cjs +29 -48
- package/dist/signature.cjs.map +1 -1
- package/dist/signature.d.cts +26 -26
- package/dist/signature.d.ts +26 -26
- package/dist/signature.js +30 -48
- package/dist/signature.js.map +1 -1
- package/dist/stage-B7BG2e8Q.cjs +369 -0
- package/dist/stage-B7BG2e8Q.cjs.map +1 -0
- package/dist/stage-BqfBjDu6.js +302 -0
- package/dist/stage-BqfBjDu6.js.map +1 -0
- package/dist/stage-ByFPD-Fv.d.cts +117 -0
- package/dist/stage-DaboaheR.d.ts +117 -0
- package/dist/stage-scope-CQgCuf1w.cjs +46 -0
- package/dist/stage-scope-CQgCuf1w.cjs.map +1 -0
- package/dist/stage-scope-D7ZeNduT.js +23 -0
- package/dist/stage-scope-D7ZeNduT.js.map +1 -0
- package/dist/stage.cjs +12 -235
- package/dist/stage.d.cts +2 -116
- package/dist/stage.d.ts +2 -116
- package/dist/stage.js +3 -228
- package/dist/stamp.cjs +41 -35
- package/dist/stamp.cjs.map +1 -1
- package/dist/stamp.d.cts +25 -18
- package/dist/stamp.d.ts +25 -18
- package/dist/stamp.js +40 -37
- package/dist/stamp.js.map +1 -1
- package/dist/state-0K1I5cM4.d.cts +29 -0
- package/dist/state-0K1I5cM4.d.ts +29 -0
- package/dist/state-CzI2KlZb.js +62 -0
- package/dist/state-CzI2KlZb.js.map +1 -0
- package/dist/state-Dtf8HAue.cjs +73 -0
- package/dist/state-Dtf8HAue.cjs.map +1 -0
- package/dist/svg-shapes-Dm1yTR1b.js +40 -0
- package/dist/svg-shapes-Dm1yTR1b.js.map +1 -0
- package/dist/svg-shapes-zo0GNkc9.cjs +53 -0
- package/dist/svg-shapes-zo0GNkc9.cjs.map +1 -0
- package/dist/toolbar.cjs +297 -295
- package/dist/toolbar.cjs.map +1 -1
- package/dist/toolbar.d.cts +58 -68
- package/dist/toolbar.d.ts +67 -77
- package/dist/toolbar.js +271 -293
- package/dist/toolbar.js.map +1 -1
- package/dist/view-manager.cjs +34 -0
- package/dist/view-manager.cjs.map +1 -0
- package/dist/view-manager.d.cts +21 -0
- package/dist/view-manager.d.ts +21 -0
- package/dist/view-manager.js +23 -0
- package/dist/view-manager.js.map +1 -0
- package/package.json +47 -39
- package/dist/annotation-BCED_p9H.d.cts +0 -160
- package/dist/annotation-anchors-CetwM1g7.js +0 -15
- package/dist/annotation-anchors-CetwM1g7.js.map +0 -1
- package/dist/annotation-anchors-DuYRBJLl.cjs +0 -26
- package/dist/annotation-anchors-DuYRBJLl.cjs.map +0 -1
- package/dist/annotation-hooks-BB5ZhPpf.cjs +0 -16
- package/dist/annotation-hooks-BB5ZhPpf.cjs.map +0 -1
- package/dist/annotation-hooks-Df8EmzDO.js +0 -11
- package/dist/annotation-hooks-Df8EmzDO.js.map +0 -1
- package/dist/annotation-k38KDlIZ.d.ts +0 -160
- package/dist/annotation-menu.cjs +0 -64
- package/dist/annotation-menu.cjs.map +0 -1
- package/dist/annotation-menu.d.cts +0 -33
- package/dist/annotation-menu.d.ts +0 -33
- package/dist/annotation-menu.js +0 -48
- package/dist/annotation-menu.js.map +0 -1
- package/dist/annotation.cjs.map +0 -1
- package/dist/annotation.js.map +0 -1
- package/dist/form-BVumS7up.cjs +0 -926
- package/dist/form-BVumS7up.cjs.map +0 -1
- package/dist/form-Bdjk0Z3T.d.cts +0 -537
- package/dist/form-CK3mp99m.js +0 -895
- package/dist/form-CK3mp99m.js.map +0 -1
- package/dist/form-CYRYgthn.d.ts +0 -537
- package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
- package/dist/runtime-DE76hlnl.d.ts +0 -216
- package/dist/runtime-umHA_xHt.d.cts +0 -216
- package/dist/runtime.cjs.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/scrollbar.cjs +0 -241
- package/dist/scrollbar.cjs.map +0 -1
- package/dist/scrollbar.d.cts +0 -42
- package/dist/scrollbar.d.ts +0 -42
- package/dist/scrollbar.js +0 -213
- package/dist/scrollbar.js.map +0 -1
- package/dist/stage.cjs.map +0 -1
- package/dist/stage.js.map +0 -1
- package/dist/views.cjs +0 -35
- package/dist/views.cjs.map +0 -1
- package/dist/views.d.cts +0 -21
- package/dist/views.d.ts +0 -21
- package/dist/views.js +0 -27
- package/dist/views.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CapabilityToken, SettingsOf, StateDeclaration } from "@embedpdf/core";
|
|
2
|
+
//#region src/state.d.ts
|
|
3
|
+
/** A declared state's hook: the whole state, or the value `select` picks from it. */
|
|
4
|
+
type StateHook<State> = <Selected = State>(select?: (state: State) => Selected) => Selected;
|
|
5
|
+
/** A plugin's settings hook: the settings, or the value `select` picks from them. */
|
|
6
|
+
type SettingsHook<Settings> = <Selected = Settings>(select?: (settings: Settings) => Selected) => Selected;
|
|
7
|
+
/**
|
|
8
|
+
* Turn a state declaration into its hook. The hook reads this subtree's
|
|
9
|
+
* document (the nearest <DocumentScope>, else the active one) and returns the
|
|
10
|
+
* declaration's `empty` while that document is missing or not ready, so it
|
|
11
|
+
* renders anywhere. It re-renders only when a field changes: the state, or the
|
|
12
|
+
* value `select` picks from it, is compared with {@link shallowEqual}. State
|
|
13
|
+
* the plugin loads on demand (the declaration's `ensure`) loads once a ready
|
|
14
|
+
* document's capability is in scope, for every document the hook reads.
|
|
15
|
+
*/
|
|
16
|
+
declare function stateHook<Capability, State extends object>(declaration: StateDeclaration<Capability, State>): StateHook<State>;
|
|
17
|
+
/**
|
|
18
|
+
* Turn a plugin's token into its settings hook. A plugin's settings belong to
|
|
19
|
+
* the plugin as the app registered it, not to a document, so the hook reads
|
|
20
|
+
* them through the kernel (`kernel.settingsOf`): it works before the first
|
|
21
|
+
* document opens, and every document shows the same settings. It re-renders
|
|
22
|
+
* only when a setting changes: `getSettings()` keeps its object until then,
|
|
23
|
+
* and the value `select` picks is compared with {@link shallowEqual}. A token
|
|
24
|
+
* whose plugin isn't installed, or has no settings, throws: a setup mistake.
|
|
25
|
+
*/
|
|
26
|
+
declare function settingsHook<Capability>(token: CapabilityToken<Capability>): SettingsHook<SettingsOf<Capability>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { stateHook as i, StateHook as n, settingsHook as r, SettingsHook as t };
|
|
29
|
+
//# sourceMappingURL=state-0K1I5cM4.d.cts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CapabilityToken, SettingsOf, StateDeclaration } from "@embedpdf/core";
|
|
2
|
+
//#region src/state.d.ts
|
|
3
|
+
/** A declared state's hook: the whole state, or the value `select` picks from it. */
|
|
4
|
+
type StateHook<State> = <Selected = State>(select?: (state: State) => Selected) => Selected;
|
|
5
|
+
/** A plugin's settings hook: the settings, or the value `select` picks from them. */
|
|
6
|
+
type SettingsHook<Settings> = <Selected = Settings>(select?: (settings: Settings) => Selected) => Selected;
|
|
7
|
+
/**
|
|
8
|
+
* Turn a state declaration into its hook. The hook reads this subtree's
|
|
9
|
+
* document (the nearest <DocumentScope>, else the active one) and returns the
|
|
10
|
+
* declaration's `empty` while that document is missing or not ready, so it
|
|
11
|
+
* renders anywhere. It re-renders only when a field changes: the state, or the
|
|
12
|
+
* value `select` picks from it, is compared with {@link shallowEqual}. State
|
|
13
|
+
* the plugin loads on demand (the declaration's `ensure`) loads once a ready
|
|
14
|
+
* document's capability is in scope, for every document the hook reads.
|
|
15
|
+
*/
|
|
16
|
+
declare function stateHook<Capability, State extends object>(declaration: StateDeclaration<Capability, State>): StateHook<State>;
|
|
17
|
+
/**
|
|
18
|
+
* Turn a plugin's token into its settings hook. A plugin's settings belong to
|
|
19
|
+
* the plugin as the app registered it, not to a document, so the hook reads
|
|
20
|
+
* them through the kernel (`kernel.settingsOf`): it works before the first
|
|
21
|
+
* document opens, and every document shows the same settings. It re-renders
|
|
22
|
+
* only when a setting changes: `getSettings()` keeps its object until then,
|
|
23
|
+
* and the value `select` picks is compared with {@link shallowEqual}. A token
|
|
24
|
+
* whose plugin isn't installed, or has no settings, throws: a setup mistake.
|
|
25
|
+
*/
|
|
26
|
+
declare function settingsHook<Capability>(token: CapabilityToken<Capability>): SettingsHook<SettingsOf<Capability>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { stateHook as i, StateHook as n, settingsHook as r, SettingsHook as t };
|
|
29
|
+
//# sourceMappingURL=state-0K1I5cM4.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { g as useDocumentScope, x as useKernelValue } from "./runtime-tD5iJU83.js";
|
|
2
|
+
import { shallowEqual } from "@embedpdf/core";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
//#region src/state.ts
|
|
5
|
+
/**
|
|
6
|
+
* Declared state and settings as React hooks. A plugin declares its state once
|
|
7
|
+
* with `defineState` and its settings once in its definition (both in
|
|
8
|
+
* `@embedpdf/core`), and its React bindings are one line each:
|
|
9
|
+
*
|
|
10
|
+
* export const useSearchState = stateHook(searchState);
|
|
11
|
+
* export const useSearchSettings = settingsHook(SearchToken);
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Turn a state declaration into its hook. The hook reads this subtree's
|
|
15
|
+
* document (the nearest <DocumentScope>, else the active one) and returns the
|
|
16
|
+
* declaration's `empty` while that document is missing or not ready, so it
|
|
17
|
+
* renders anywhere. It re-renders only when a field changes: the state, or the
|
|
18
|
+
* value `select` picks from it, is compared with {@link shallowEqual}. State
|
|
19
|
+
* the plugin loads on demand (the declaration's `ensure`) loads once a ready
|
|
20
|
+
* document's capability is in scope, for every document the hook reads.
|
|
21
|
+
*/
|
|
22
|
+
function stateHook(declaration) {
|
|
23
|
+
const { ensure } = declaration;
|
|
24
|
+
const useDeclaredState = function useDeclaredState(select) {
|
|
25
|
+
const scoped = useDocumentScope();
|
|
26
|
+
return useKernelValue((kernel) => {
|
|
27
|
+
const capability = kernel.tryCapability(declaration.token, scoped ?? void 0);
|
|
28
|
+
const state = capability ? declaration.read(capability) : declaration.empty;
|
|
29
|
+
return select ? select(state) : state;
|
|
30
|
+
}, shallowEqual);
|
|
31
|
+
};
|
|
32
|
+
if (!ensure) return useDeclaredState;
|
|
33
|
+
return function useLoadedState(select) {
|
|
34
|
+
const scoped = useDocumentScope();
|
|
35
|
+
const capability = useKernelValue((kernel) => kernel.tryCapability(declaration.token, scoped ?? void 0), Object.is);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (capability) ensure(capability).catch(() => {});
|
|
38
|
+
}, [capability]);
|
|
39
|
+
return useDeclaredState(select);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Turn a plugin's token into its settings hook. A plugin's settings belong to
|
|
44
|
+
* the plugin as the app registered it, not to a document, so the hook reads
|
|
45
|
+
* them through the kernel (`kernel.settingsOf`): it works before the first
|
|
46
|
+
* document opens, and every document shows the same settings. It re-renders
|
|
47
|
+
* only when a setting changes: `getSettings()` keeps its object until then,
|
|
48
|
+
* and the value `select` picks is compared with {@link shallowEqual}. A token
|
|
49
|
+
* whose plugin isn't installed, or has no settings, throws: a setup mistake.
|
|
50
|
+
*/
|
|
51
|
+
function settingsHook(token) {
|
|
52
|
+
return function useSettings(select) {
|
|
53
|
+
return useKernelValue((kernel) => {
|
|
54
|
+
const settings = kernel.settingsOf(token).getSettings();
|
|
55
|
+
return select ? select(settings) : settings;
|
|
56
|
+
}, shallowEqual);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { stateHook as n, settingsHook as t };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=state-CzI2KlZb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-CzI2KlZb.js","names":[],"sources":["../src/state.ts"],"sourcesContent":["/**\n * Declared state and settings as React hooks. A plugin declares its state once\n * with `defineState` and its settings once in its definition (both in\n * `@embedpdf/core`), and its React bindings are one line each:\n *\n * export const useSearchState = stateHook(searchState);\n * export const useSearchSettings = settingsHook(SearchToken);\n */\nimport { useEffect } from 'react';\nimport { shallowEqual } from '@embedpdf/core';\nimport type { CapabilityToken, SettingsOf, StateDeclaration } from '@embedpdf/core';\nimport { useDocumentScope, useKernelValue } from './runtime';\n\n/** A declared state's hook: the whole state, or the value `select` picks from it. */\nexport type StateHook<State> = <Selected = State>(select?: (state: State) => Selected) => Selected;\n\n/** A plugin's settings hook: the settings, or the value `select` picks from them. */\nexport type SettingsHook<Settings> = <Selected = Settings>(\n select?: (settings: Settings) => Selected,\n) => Selected;\n\n/**\n * Turn a state declaration into its hook. The hook reads this subtree's\n * document (the nearest <DocumentScope>, else the active one) and returns the\n * declaration's `empty` while that document is missing or not ready, so it\n * renders anywhere. It re-renders only when a field changes: the state, or the\n * value `select` picks from it, is compared with {@link shallowEqual}. State\n * the plugin loads on demand (the declaration's `ensure`) loads once a ready\n * document's capability is in scope, for every document the hook reads.\n */\nexport function stateHook<Capability, State extends object>(\n declaration: StateDeclaration<Capability, State>,\n): StateHook<State> {\n const { ensure } = declaration;\n const useDeclaredState = function useDeclaredState<Selected = State>(\n select?: (state: State) => Selected,\n ): Selected {\n const scoped = useDocumentScope();\n // Resolve on every read, not once per render: a document that closes\n // between a store change and the next render then reads as `empty`,\n // never through its closed capability.\n return useKernelValue((kernel) => {\n const capability = kernel.tryCapability(declaration.token, scoped ?? undefined);\n const state = capability ? declaration.read(capability) : declaration.empty;\n return select ? select(state) : (state as unknown as Selected);\n }, shallowEqual);\n };\n if (!ensure) return useDeclaredState;\n return function useLoadedState<Selected = State>(select?: (state: State) => Selected): Selected {\n const scoped = useDocumentScope();\n const capability = useKernelValue(\n (kernel) => kernel.tryCapability(declaration.token, scoped ?? undefined),\n Object.is,\n );\n // The state says when the load fails (its status), so the rejection has nothing to add.\n useEffect(() => {\n if (capability) ensure(capability).catch(() => {});\n }, [capability]);\n return useDeclaredState(select);\n };\n}\n\n/**\n * Turn a plugin's token into its settings hook. A plugin's settings belong to\n * the plugin as the app registered it, not to a document, so the hook reads\n * them through the kernel (`kernel.settingsOf`): it works before the first\n * document opens, and every document shows the same settings. It re-renders\n * only when a setting changes: `getSettings()` keeps its object until then,\n * and the value `select` picks is compared with {@link shallowEqual}. A token\n * whose plugin isn't installed, or has no settings, throws: a setup mistake.\n */\nexport function settingsHook<Capability>(\n token: CapabilityToken<Capability>,\n): SettingsHook<SettingsOf<Capability>> {\n return function useSettings<Selected = SettingsOf<Capability>>(\n select?: (settings: SettingsOf<Capability>) => Selected,\n ): Selected {\n return useKernelValue((kernel) => {\n const settings = kernel.settingsOf(token).getSettings();\n return select ? select(settings) : (settings as unknown as Selected);\n }, shallowEqual);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,UACd,aACkB;CAClB,MAAM,EAAE,WAAW;CACnB,MAAM,mBAAmB,SAAS,iBAChC,QACU;EACV,MAAM,SAAS,iBAAiB;EAIhC,OAAO,gBAAgB,WAAW;GAChC,MAAM,aAAa,OAAO,cAAc,YAAY,OAAO,UAAU,KAAA,CAAS;GAC9E,MAAM,QAAQ,aAAa,YAAY,KAAK,UAAU,IAAI,YAAY;GACtE,OAAO,SAAS,OAAO,KAAK,IAAK;EACnC,GAAG,YAAY;CACjB;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,SAAS,eAAiC,QAA+C;EAC9F,MAAM,SAAS,iBAAiB;EAChC,MAAM,aAAa,gBAChB,WAAW,OAAO,cAAc,YAAY,OAAO,UAAU,KAAA,CAAS,GACvE,OAAO,EACT;EAEA,gBAAgB;GACd,IAAI,YAAY,OAAO,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;EACnD,GAAG,CAAC,UAAU,CAAC;EACf,OAAO,iBAAiB,MAAM;CAChC;AACF;;;;;;;;;;AAWA,SAAgB,aACd,OACsC;CACtC,OAAO,SAAS,YACd,QACU;EACV,OAAO,gBAAgB,WAAW;GAChC,MAAM,WAAW,OAAO,WAAW,KAAK,CAAC,CAAC,YAAY;GACtD,OAAO,SAAS,OAAO,QAAQ,IAAK;EACtC,GAAG,YAAY;CACjB;AACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const require_runtime = require("./runtime-BfnpyfY0.cjs");
|
|
2
|
+
let _embedpdf_core = require("@embedpdf/core");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
//#region src/state.ts
|
|
5
|
+
/**
|
|
6
|
+
* Declared state and settings as React hooks. A plugin declares its state once
|
|
7
|
+
* with `defineState` and its settings once in its definition (both in
|
|
8
|
+
* `@embedpdf/core`), and its React bindings are one line each:
|
|
9
|
+
*
|
|
10
|
+
* export const useSearchState = stateHook(searchState);
|
|
11
|
+
* export const useSearchSettings = settingsHook(SearchToken);
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Turn a state declaration into its hook. The hook reads this subtree's
|
|
15
|
+
* document (the nearest <DocumentScope>, else the active one) and returns the
|
|
16
|
+
* declaration's `empty` while that document is missing or not ready, so it
|
|
17
|
+
* renders anywhere. It re-renders only when a field changes: the state, or the
|
|
18
|
+
* value `select` picks from it, is compared with {@link shallowEqual}. State
|
|
19
|
+
* the plugin loads on demand (the declaration's `ensure`) loads once a ready
|
|
20
|
+
* document's capability is in scope, for every document the hook reads.
|
|
21
|
+
*/
|
|
22
|
+
function stateHook(declaration) {
|
|
23
|
+
const { ensure } = declaration;
|
|
24
|
+
const useDeclaredState = function useDeclaredState(select) {
|
|
25
|
+
const scoped = require_runtime.useDocumentScope();
|
|
26
|
+
return require_runtime.useKernelValue((kernel) => {
|
|
27
|
+
const capability = kernel.tryCapability(declaration.token, scoped ?? void 0);
|
|
28
|
+
const state = capability ? declaration.read(capability) : declaration.empty;
|
|
29
|
+
return select ? select(state) : state;
|
|
30
|
+
}, _embedpdf_core.shallowEqual);
|
|
31
|
+
};
|
|
32
|
+
if (!ensure) return useDeclaredState;
|
|
33
|
+
return function useLoadedState(select) {
|
|
34
|
+
const scoped = require_runtime.useDocumentScope();
|
|
35
|
+
const capability = require_runtime.useKernelValue((kernel) => kernel.tryCapability(declaration.token, scoped ?? void 0), Object.is);
|
|
36
|
+
(0, react.useEffect)(() => {
|
|
37
|
+
if (capability) ensure(capability).catch(() => {});
|
|
38
|
+
}, [capability]);
|
|
39
|
+
return useDeclaredState(select);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Turn a plugin's token into its settings hook. A plugin's settings belong to
|
|
44
|
+
* the plugin as the app registered it, not to a document, so the hook reads
|
|
45
|
+
* them through the kernel (`kernel.settingsOf`): it works before the first
|
|
46
|
+
* document opens, and every document shows the same settings. It re-renders
|
|
47
|
+
* only when a setting changes: `getSettings()` keeps its object until then,
|
|
48
|
+
* and the value `select` picks is compared with {@link shallowEqual}. A token
|
|
49
|
+
* whose plugin isn't installed, or has no settings, throws: a setup mistake.
|
|
50
|
+
*/
|
|
51
|
+
function settingsHook(token) {
|
|
52
|
+
return function useSettings(select) {
|
|
53
|
+
return require_runtime.useKernelValue((kernel) => {
|
|
54
|
+
const settings = kernel.settingsOf(token).getSettings();
|
|
55
|
+
return select ? select(settings) : settings;
|
|
56
|
+
}, _embedpdf_core.shallowEqual);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
Object.defineProperty(exports, "settingsHook", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function() {
|
|
63
|
+
return settingsHook;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "stateHook", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function() {
|
|
69
|
+
return stateHook;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=state-Dtf8HAue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-Dtf8HAue.cjs","names":["useDocumentScope","useKernelValue","shallowEqual"],"sources":["../src/state.ts"],"sourcesContent":["/**\n * Declared state and settings as React hooks. A plugin declares its state once\n * with `defineState` and its settings once in its definition (both in\n * `@embedpdf/core`), and its React bindings are one line each:\n *\n * export const useSearchState = stateHook(searchState);\n * export const useSearchSettings = settingsHook(SearchToken);\n */\nimport { useEffect } from 'react';\nimport { shallowEqual } from '@embedpdf/core';\nimport type { CapabilityToken, SettingsOf, StateDeclaration } from '@embedpdf/core';\nimport { useDocumentScope, useKernelValue } from './runtime';\n\n/** A declared state's hook: the whole state, or the value `select` picks from it. */\nexport type StateHook<State> = <Selected = State>(select?: (state: State) => Selected) => Selected;\n\n/** A plugin's settings hook: the settings, or the value `select` picks from them. */\nexport type SettingsHook<Settings> = <Selected = Settings>(\n select?: (settings: Settings) => Selected,\n) => Selected;\n\n/**\n * Turn a state declaration into its hook. The hook reads this subtree's\n * document (the nearest <DocumentScope>, else the active one) and returns the\n * declaration's `empty` while that document is missing or not ready, so it\n * renders anywhere. It re-renders only when a field changes: the state, or the\n * value `select` picks from it, is compared with {@link shallowEqual}. State\n * the plugin loads on demand (the declaration's `ensure`) loads once a ready\n * document's capability is in scope, for every document the hook reads.\n */\nexport function stateHook<Capability, State extends object>(\n declaration: StateDeclaration<Capability, State>,\n): StateHook<State> {\n const { ensure } = declaration;\n const useDeclaredState = function useDeclaredState<Selected = State>(\n select?: (state: State) => Selected,\n ): Selected {\n const scoped = useDocumentScope();\n // Resolve on every read, not once per render: a document that closes\n // between a store change and the next render then reads as `empty`,\n // never through its closed capability.\n return useKernelValue((kernel) => {\n const capability = kernel.tryCapability(declaration.token, scoped ?? undefined);\n const state = capability ? declaration.read(capability) : declaration.empty;\n return select ? select(state) : (state as unknown as Selected);\n }, shallowEqual);\n };\n if (!ensure) return useDeclaredState;\n return function useLoadedState<Selected = State>(select?: (state: State) => Selected): Selected {\n const scoped = useDocumentScope();\n const capability = useKernelValue(\n (kernel) => kernel.tryCapability(declaration.token, scoped ?? undefined),\n Object.is,\n );\n // The state says when the load fails (its status), so the rejection has nothing to add.\n useEffect(() => {\n if (capability) ensure(capability).catch(() => {});\n }, [capability]);\n return useDeclaredState(select);\n };\n}\n\n/**\n * Turn a plugin's token into its settings hook. A plugin's settings belong to\n * the plugin as the app registered it, not to a document, so the hook reads\n * them through the kernel (`kernel.settingsOf`): it works before the first\n * document opens, and every document shows the same settings. It re-renders\n * only when a setting changes: `getSettings()` keeps its object until then,\n * and the value `select` picks is compared with {@link shallowEqual}. A token\n * whose plugin isn't installed, or has no settings, throws: a setup mistake.\n */\nexport function settingsHook<Capability>(\n token: CapabilityToken<Capability>,\n): SettingsHook<SettingsOf<Capability>> {\n return function useSettings<Selected = SettingsOf<Capability>>(\n select?: (settings: SettingsOf<Capability>) => Selected,\n ): Selected {\n return useKernelValue((kernel) => {\n const settings = kernel.settingsOf(token).getSettings();\n return select ? select(settings) : (settings as unknown as Selected);\n }, shallowEqual);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,UACd,aACkB;CAClB,MAAM,EAAE,WAAW;CACnB,MAAM,mBAAmB,SAAS,iBAChC,QACU;EACV,MAAM,SAASA,gBAAAA,iBAAiB;EAIhC,OAAOC,gBAAAA,gBAAgB,WAAW;GAChC,MAAM,aAAa,OAAO,cAAc,YAAY,OAAO,UAAU,KAAA,CAAS;GAC9E,MAAM,QAAQ,aAAa,YAAY,KAAK,UAAU,IAAI,YAAY;GACtE,OAAO,SAAS,OAAO,KAAK,IAAK;EACnC,GAAGC,eAAAA,YAAY;CACjB;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,SAAS,eAAiC,QAA+C;EAC9F,MAAM,SAASF,gBAAAA,iBAAiB;EAChC,MAAM,aAAaC,gBAAAA,gBAChB,WAAW,OAAO,cAAc,YAAY,OAAO,UAAU,KAAA,CAAS,GACvE,OAAO,EACT;EAEA,CAAA,GAAA,MAAA,UAAA,OAAgB;GACd,IAAI,YAAY,OAAO,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;EACnD,GAAG,CAAC,UAAU,CAAC;EACf,OAAO,iBAAiB,MAAM;CAChC;AACF;;;;;;;;;;AAWA,SAAgB,aACd,OACsC;CACtC,OAAO,SAAS,YACd,QACU;EACV,OAAOA,gBAAAA,gBAAgB,WAAW;GAChC,MAAM,WAAW,OAAO,WAAW,KAAK,CAAC,CAAC,YAAY;GACtD,OAAO,SAAS,OAAO,QAAQ,IAAK;EACtC,GAAGC,eAAAA,YAAY;CACjB;AACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFontMounts, fontProgramsOf } from "@embedpdf/web";
|
|
3
|
+
import React, { useEffect, useState } from "react";
|
|
4
|
+
//#region src/font-mounts.ts
|
|
5
|
+
/**
|
|
6
|
+
* The engine's faces a part of a layer draws text in, mounted while it's
|
|
7
|
+
* there (`@embedpdf/web`'s `createFontMounts`, one set per component).
|
|
8
|
+
*/
|
|
9
|
+
function useFontMounts(programs) {
|
|
10
|
+
const [mounts] = useState(() => createFontMounts());
|
|
11
|
+
useEffect(() => () => mounts.release(), [mounts]);
|
|
12
|
+
useEffect(() => mounts.mount(programs));
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/svg-shapes.tsx
|
|
16
|
+
/**
|
|
17
|
+
* Scene shapes as React elements: `@embedpdf/web`'s element descriptions
|
|
18
|
+
* (`svgShapesOf`), one element each, a clipping `svg` with its children, and
|
|
19
|
+
* the faces their text draws in mounted while they show. The annotation and
|
|
20
|
+
* form layers draw their scenes through it.
|
|
21
|
+
*/
|
|
22
|
+
function SvgShapes({ shapes }) {
|
|
23
|
+
useFontMounts(fontProgramsOf(shapes));
|
|
24
|
+
return /* @__PURE__ */ jsx(Fragment, { children: svgElements(shapes) });
|
|
25
|
+
}
|
|
26
|
+
/** SVG attribute names as React's props: `stroke-width` is `strokeWidth`. */
|
|
27
|
+
function reactProps(attributes) {
|
|
28
|
+
return Object.fromEntries(Object.entries(attributes).map(([name, value]) => [name.replace(/-([a-z])/g, (_dash, letter) => letter.toUpperCase()), value]));
|
|
29
|
+
}
|
|
30
|
+
function svgElements(shapes) {
|
|
31
|
+
return shapes.map((shape, index) => React.createElement(shape.tag, {
|
|
32
|
+
key: index,
|
|
33
|
+
...reactProps(shape.attributes),
|
|
34
|
+
...shape.blend ? { style: { mixBlendMode: shape.blend } } : {}
|
|
35
|
+
}, shape.children ? svgElements(shape.children) : shape.text));
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { useFontMounts as n, SvgShapes as t };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=svg-shapes-Dm1yTR1b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-shapes-Dm1yTR1b.js","names":[],"sources":["../src/font-mounts.ts","../src/svg-shapes.tsx"],"sourcesContent":["/**\n * The engine's faces a part of a layer draws text in, mounted while it's\n * there (`@embedpdf/web`'s `createFontMounts`, one set per component).\n */\nimport { createFontMounts, type MountableFontProgram } from '@embedpdf/web';\nimport { useEffect, useState } from 'react';\n\nexport function useFontMounts(programs: readonly MountableFontProgram[]): void {\n const [mounts] = useState(() => createFontMounts());\n useEffect(() => () => mounts.release(), [mounts]);\n useEffect(() => mounts.mount(programs));\n}\n","/**\n * Scene shapes as React elements: `@embedpdf/web`'s element descriptions\n * (`svgShapesOf`), one element each, a clipping `svg` with its children, and\n * the faces their text draws in mounted while they show. The annotation and\n * form layers draw their scenes through it.\n */\nimport { fontProgramsOf, type SvgShape } from '@embedpdf/web';\nimport React from 'react';\n\nimport { useFontMounts } from './font-mounts';\n\nexport function SvgShapes({ shapes }: { shapes: readonly SvgShape[] }) {\n useFontMounts(fontProgramsOf(shapes));\n return <>{svgElements(shapes)}</>;\n}\n\n/** SVG attribute names as React's props: `stroke-width` is `strokeWidth`. */\nfunction reactProps(attributes: Readonly<Record<string, string | number>>) {\n return Object.fromEntries(\n Object.entries(attributes).map(([name, value]) => [\n name.replace(/-([a-z])/g, (_dash, letter: string) => letter.toUpperCase()),\n value,\n ]),\n );\n}\n\nfunction svgElements(shapes: readonly SvgShape[]): React.ReactNode[] {\n return shapes.map((shape, index) =>\n React.createElement(\n shape.tag,\n {\n key: index,\n ...reactProps(shape.attributes),\n ...(shape.blend\n ? { style: { mixBlendMode: shape.blend as React.CSSProperties['mixBlendMode'] } }\n : {}),\n },\n shape.children ? svgElements(shape.children) : shape.text,\n ),\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,cAAc,UAAiD;CAC7E,MAAM,CAAC,UAAU,eAAe,iBAAiB,CAAC;CAClD,sBAAsB,OAAO,QAAQ,GAAG,CAAC,MAAM,CAAC;CAChD,gBAAgB,OAAO,MAAM,QAAQ,CAAC;AACxC;;;;;;;;;ACAA,SAAgB,UAAU,EAAE,UAA2C;CACrE,cAAc,eAAe,MAAM,CAAC;CACpC,OAAO,oBAAA,UAAA,EAAA,UAAG,YAAY,MAAM,EAAI,CAAA;AAClC;;AAGA,SAAS,WAAW,YAAuD;CACzE,OAAO,OAAO,YACZ,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAChD,KAAK,QAAQ,cAAc,OAAO,WAAmB,OAAO,YAAY,CAAC,GACzE,KACF,CAAC,CACH;AACF;AAEA,SAAS,YAAY,QAAgD;CACnE,OAAO,OAAO,KAAK,OAAO,UACxB,MAAM,cACJ,MAAM,KACN;EACE,KAAK;EACL,GAAG,WAAW,MAAM,UAAU;EAC9B,GAAI,MAAM,QACN,EAAE,OAAO,EAAE,cAAc,MAAM,MAA6C,EAAE,IAC9E,CAAC;CACP,GACA,MAAM,WAAW,YAAY,MAAM,QAAQ,IAAI,MAAM,IACvD,CACF;AACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DDXJien1.cjs");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let _embedpdf_web = require("@embedpdf/web");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
6
|
+
//#region src/font-mounts.ts
|
|
7
|
+
/**
|
|
8
|
+
* The engine's faces a part of a layer draws text in, mounted while it's
|
|
9
|
+
* there (`@embedpdf/web`'s `createFontMounts`, one set per component).
|
|
10
|
+
*/
|
|
11
|
+
function useFontMounts(programs) {
|
|
12
|
+
const [mounts] = (0, react.useState)(() => (0, _embedpdf_web.createFontMounts)());
|
|
13
|
+
(0, react.useEffect)(() => () => mounts.release(), [mounts]);
|
|
14
|
+
(0, react.useEffect)(() => mounts.mount(programs));
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/svg-shapes.tsx
|
|
18
|
+
/**
|
|
19
|
+
* Scene shapes as React elements: `@embedpdf/web`'s element descriptions
|
|
20
|
+
* (`svgShapesOf`), one element each, a clipping `svg` with its children, and
|
|
21
|
+
* the faces their text draws in mounted while they show. The annotation and
|
|
22
|
+
* form layers draw their scenes through it.
|
|
23
|
+
*/
|
|
24
|
+
function SvgShapes({ shapes }) {
|
|
25
|
+
useFontMounts((0, _embedpdf_web.fontProgramsOf)(shapes));
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: svgElements(shapes) });
|
|
27
|
+
}
|
|
28
|
+
/** SVG attribute names as React's props: `stroke-width` is `strokeWidth`. */
|
|
29
|
+
function reactProps(attributes) {
|
|
30
|
+
return Object.fromEntries(Object.entries(attributes).map(([name, value]) => [name.replace(/-([a-z])/g, (_dash, letter) => letter.toUpperCase()), value]));
|
|
31
|
+
}
|
|
32
|
+
function svgElements(shapes) {
|
|
33
|
+
return shapes.map((shape, index) => react.default.createElement(shape.tag, {
|
|
34
|
+
key: index,
|
|
35
|
+
...reactProps(shape.attributes),
|
|
36
|
+
...shape.blend ? { style: { mixBlendMode: shape.blend } } : {}
|
|
37
|
+
}, shape.children ? svgElements(shape.children) : shape.text));
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
Object.defineProperty(exports, "SvgShapes", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function() {
|
|
43
|
+
return SvgShapes;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "useFontMounts", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function() {
|
|
49
|
+
return useFontMounts;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=svg-shapes-zo0GNkc9.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-shapes-zo0GNkc9.cjs","names":["React"],"sources":["../src/font-mounts.ts","../src/svg-shapes.tsx"],"sourcesContent":["/**\n * The engine's faces a part of a layer draws text in, mounted while it's\n * there (`@embedpdf/web`'s `createFontMounts`, one set per component).\n */\nimport { createFontMounts, type MountableFontProgram } from '@embedpdf/web';\nimport { useEffect, useState } from 'react';\n\nexport function useFontMounts(programs: readonly MountableFontProgram[]): void {\n const [mounts] = useState(() => createFontMounts());\n useEffect(() => () => mounts.release(), [mounts]);\n useEffect(() => mounts.mount(programs));\n}\n","/**\n * Scene shapes as React elements: `@embedpdf/web`'s element descriptions\n * (`svgShapesOf`), one element each, a clipping `svg` with its children, and\n * the faces their text draws in mounted while they show. The annotation and\n * form layers draw their scenes through it.\n */\nimport { fontProgramsOf, type SvgShape } from '@embedpdf/web';\nimport React from 'react';\n\nimport { useFontMounts } from './font-mounts';\n\nexport function SvgShapes({ shapes }: { shapes: readonly SvgShape[] }) {\n useFontMounts(fontProgramsOf(shapes));\n return <>{svgElements(shapes)}</>;\n}\n\n/** SVG attribute names as React's props: `stroke-width` is `strokeWidth`. */\nfunction reactProps(attributes: Readonly<Record<string, string | number>>) {\n return Object.fromEntries(\n Object.entries(attributes).map(([name, value]) => [\n name.replace(/-([a-z])/g, (_dash, letter: string) => letter.toUpperCase()),\n value,\n ]),\n );\n}\n\nfunction svgElements(shapes: readonly SvgShape[]): React.ReactNode[] {\n return shapes.map((shape, index) =>\n React.createElement(\n shape.tag,\n {\n key: index,\n ...reactProps(shape.attributes),\n ...(shape.blend\n ? { style: { mixBlendMode: shape.blend as React.CSSProperties['mixBlendMode'] } }\n : {}),\n },\n shape.children ? svgElements(shape.children) : shape.text,\n ),\n );\n}\n"],"mappings":";;;;;;;;;;AAOA,SAAgB,cAAc,UAAiD;CAC7E,MAAM,CAAC,WAAA,GAAA,MAAA,SAAA,QAAA,GAAA,cAAA,iBAAA,CAA0C,CAAC;CAClD,CAAA,GAAA,MAAA,UAAA,aAAsB,OAAO,QAAQ,GAAG,CAAC,MAAM,CAAC;CAChD,CAAA,GAAA,MAAA,UAAA,OAAgB,OAAO,MAAM,QAAQ,CAAC;AACxC;;;;;;;;;ACAA,SAAgB,UAAU,EAAE,UAA2C;CACrE,eAAA,GAAA,cAAA,eAAA,CAA6B,MAAM,CAAC;CACpC,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UAAG,YAAY,MAAM,EAAI,CAAA;AAClC;;AAGA,SAAS,WAAW,YAAuD;CACzE,OAAO,OAAO,YACZ,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAChD,KAAK,QAAQ,cAAc,OAAO,WAAmB,OAAO,YAAY,CAAC,GACzE,KACF,CAAC,CACH;AACF;AAEA,SAAS,YAAY,QAAgD;CACnE,OAAO,OAAO,KAAK,OAAO,UACxBA,MAAAA,QAAM,cACJ,MAAM,KACN;EACE,KAAK;EACL,GAAG,WAAW,MAAM,UAAU;EAC9B,GAAI,MAAM,QACN,EAAE,OAAO,EAAE,cAAc,MAAM,MAA6C,EAAE,IAC9E,CAAC;CACP,GACA,MAAM,WAAW,YAAY,MAAM,QAAQ,IAAI,MAAM,IACvD,CACF;AACF"}
|