@gtkx/react 1.0.0-rc.1 → 1.0.0-rc.2
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/adw/config.d.ts +2 -0
- package/dist/adw/config.d.ts.map +1 -0
- package/dist/adw/config.js +2 -0
- package/dist/adw/config.js.map +1 -0
- package/dist/{libraries/adw → adw}/dialog.d.ts +2 -2
- package/dist/adw/dialog.d.ts.map +1 -0
- package/dist/adw/dialog.js +25 -0
- package/dist/adw/dialog.js.map +1 -0
- package/dist/adw/element-behaviors.d.ts +2 -0
- package/dist/adw/element-behaviors.d.ts.map +1 -0
- package/dist/adw/element-behaviors.js +299 -0
- package/dist/adw/element-behaviors.js.map +1 -0
- package/dist/adw/element-config.d.ts +9 -0
- package/dist/adw/element-config.d.ts.map +1 -0
- package/dist/adw/element-config.js +137 -0
- package/dist/adw/element-config.js.map +1 -0
- package/dist/adw/index.d.ts +4 -0
- package/dist/adw/index.d.ts.map +1 -0
- package/dist/adw/index.js +3 -0
- package/dist/adw/index.js.map +1 -0
- package/dist/adw/prop-types.d.ts +29 -0
- package/dist/adw/prop-types.d.ts.map +1 -0
- package/dist/adw/prop-types.js +2 -0
- package/dist/adw/prop-types.js.map +1 -0
- package/dist/bootstrap.d.ts +2 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +5 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/components/application.d.ts +2 -2
- package/dist/components/application.d.ts.map +1 -1
- package/dist/components/application.js +31 -18
- package/dist/components/application.js.map +1 -1
- package/dist/components/element.d.ts +6 -0
- package/dist/components/element.d.ts.map +1 -0
- package/dist/components/element.js +29 -0
- package/dist/components/element.js.map +1 -0
- package/dist/components/window.d.ts +2 -2
- package/dist/components/window.d.ts.map +1 -1
- package/dist/components/window.js +10 -11
- package/dist/components/window.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -0
- package/dist/element-behaviors.d.ts +2 -0
- package/dist/element-behaviors.d.ts.map +1 -0
- package/dist/element-behaviors.js +348 -0
- package/dist/element-behaviors.js.map +1 -0
- package/dist/element-config.d.ts +10 -0
- package/dist/element-config.d.ts.map +1 -0
- package/dist/element-config.js +146 -0
- package/dist/element-config.js.map +1 -0
- package/dist/hooks/use-application.d.ts +4 -3
- package/dist/hooks/use-application.d.ts.map +1 -1
- package/dist/hooks/use-application.js +5 -4
- package/dist/hooks/use-application.js.map +1 -1
- package/dist/hooks/use-bind-setting.d.ts +21 -4
- package/dist/hooks/use-bind-setting.d.ts.map +1 -1
- package/dist/hooks/use-bind-setting.js +27 -16
- package/dist/hooks/use-bind-setting.js.map +1 -1
- package/dist/hooks/use-merged-refs.d.ts +8 -0
- package/dist/hooks/use-merged-refs.d.ts.map +1 -0
- package/dist/hooks/use-merged-refs.js +48 -0
- package/dist/hooks/use-merged-refs.js.map +1 -0
- package/dist/hooks/use-object-value.d.ts +3 -2
- package/dist/hooks/use-object-value.d.ts.map +1 -1
- package/dist/hooks/use-object-value.js +18 -21
- package/dist/hooks/use-object-value.js.map +1 -1
- package/dist/hooks/use-parent-window.d.ts +3 -2
- package/dist/hooks/use-parent-window.d.ts.map +1 -1
- package/dist/hooks/use-parent-window.js +3 -2
- package/dist/hooks/use-parent-window.js.map +1 -1
- package/dist/hooks/use-property.d.ts +5 -5
- package/dist/hooks/use-property.d.ts.map +1 -1
- package/dist/hooks/use-property.js +4 -3
- package/dist/hooks/use-property.js.map +1 -1
- package/dist/hooks/use-setting.d.ts +5 -16
- package/dist/hooks/use-setting.d.ts.map +1 -1
- package/dist/hooks/use-setting.js +16 -11
- package/dist/hooks/use-setting.js.map +1 -1
- package/dist/hooks/use-signal.d.ts +10 -7
- package/dist/hooks/use-signal.d.ts.map +1 -1
- package/dist/hooks/use-signal.js +29 -18
- package/dist/hooks/use-signal.js.map +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +6 -7
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +5 -7
- package/dist/internal.js.map +1 -1
- package/dist/prop-types.d.ts +110 -0
- package/dist/prop-types.d.ts.map +1 -0
- package/dist/prop-types.js +2 -0
- package/dist/prop-types.js.map +1 -0
- package/dist/reconciler/apply-props.d.ts +10 -7
- package/dist/reconciler/apply-props.d.ts.map +1 -1
- package/dist/reconciler/apply-props.js +182 -84
- package/dist/reconciler/apply-props.js.map +1 -1
- package/dist/reconciler/behaviors.d.ts +59 -0
- package/dist/reconciler/behaviors.d.ts.map +1 -0
- package/dist/reconciler/behaviors.js +172 -0
- package/dist/reconciler/behaviors.js.map +1 -0
- package/dist/reconciler/child-routing.d.ts +5 -0
- package/dist/reconciler/child-routing.d.ts.map +1 -0
- package/dist/reconciler/child-routing.js +156 -0
- package/dist/reconciler/child-routing.js.map +1 -0
- package/dist/reconciler/host-config.d.ts +8 -12
- package/dist/reconciler/host-config.d.ts.map +1 -1
- package/dist/reconciler/host-config.js +175 -270
- package/dist/reconciler/host-config.js.map +1 -1
- package/dist/reconciler/instance.d.ts +4 -5
- package/dist/reconciler/instance.d.ts.map +1 -1
- package/dist/reconciler/instance.js +44 -22
- package/dist/reconciler/instance.js.map +1 -1
- package/dist/reconciler/metadata.d.ts +17 -0
- package/dist/reconciler/metadata.d.ts.map +1 -0
- package/dist/reconciler/metadata.js +82 -0
- package/dist/reconciler/metadata.js.map +1 -0
- package/dist/reconciler/node.d.ts +76 -0
- package/dist/reconciler/node.d.ts.map +1 -0
- package/dist/reconciler/node.js +53 -0
- package/dist/reconciler/node.js.map +1 -0
- package/dist/reconciler/placement.d.ts +5 -0
- package/dist/reconciler/placement.d.ts.map +1 -0
- package/dist/reconciler/placement.js +175 -0
- package/dist/reconciler/placement.js.map +1 -0
- package/dist/reconciler/registry.d.ts +92 -0
- package/dist/reconciler/registry.d.ts.map +1 -0
- package/dist/reconciler/registry.js +64 -0
- package/dist/reconciler/registry.js.map +1 -0
- package/dist/reconciler/root-element.d.ts +9 -12
- package/dist/reconciler/root-element.d.ts.map +1 -1
- package/dist/reconciler/root-element.js +6 -6
- package/dist/reconciler/root-element.js.map +1 -1
- package/dist/reconciler/root.d.ts +56 -0
- package/dist/reconciler/root.d.ts.map +1 -0
- package/dist/reconciler/root.js +109 -0
- package/dist/reconciler/root.js.map +1 -0
- package/dist/reconciler/signals.d.ts +10 -0
- package/dist/reconciler/signals.d.ts.map +1 -0
- package/dist/reconciler/signals.js +70 -0
- package/dist/reconciler/signals.js.map +1 -0
- package/dist/reconciler/text.d.ts +19 -0
- package/dist/reconciler/text.d.ts.map +1 -0
- package/dist/reconciler/text.js +276 -0
- package/dist/reconciler/text.js.map +1 -0
- package/dist/utils/accessible-metadata.d.ts +11 -4
- package/dist/utils/accessible-metadata.d.ts.map +1 -1
- package/dist/utils/accessible-metadata.js +20 -17
- package/dist/utils/accessible-metadata.js.map +1 -1
- package/dist/{reconciler/accessible.d.ts → utils/accessible-props.d.ts} +7 -6
- package/dist/utils/accessible-props.d.ts.map +1 -0
- package/dist/utils/accessible-props.js +181 -0
- package/dist/utils/accessible-props.js.map +1 -0
- package/dist/utils/ref-prop.d.ts +15 -0
- package/dist/utils/ref-prop.d.ts.map +1 -0
- package/dist/utils/ref-prop.js +18 -0
- package/dist/utils/ref-prop.js.map +1 -0
- package/dist/utils/settings.d.ts +17 -0
- package/dist/utils/settings.d.ts.map +1 -0
- package/dist/utils/settings.js +37 -0
- package/dist/utils/settings.js.map +1 -0
- package/dist/utils/variant.d.ts +57 -0
- package/dist/utils/variant.d.ts.map +1 -0
- package/dist/utils/variant.js +197 -0
- package/dist/utils/variant.js.map +1 -0
- package/env.d.ts +9 -0
- package/package.json +36 -11
- package/src/adw/config.ts +1 -0
- package/src/adw/dialog.tsx +35 -0
- package/src/adw/element-behaviors.ts +379 -0
- package/src/adw/element-config.ts +140 -0
- package/src/adw/index.ts +4 -0
- package/src/adw/prop-types.ts +42 -0
- package/src/bootstrap.ts +5 -0
- package/src/components/application.tsx +42 -23
- package/src/components/element.tsx +47 -0
- package/src/components/window.tsx +12 -13
- package/src/config.ts +3 -0
- package/src/element-behaviors.ts +424 -0
- package/src/element-config.ts +148 -0
- package/src/env.d.ts +1 -0
- package/src/hooks/use-application.ts +6 -4
- package/src/hooks/use-bind-setting.ts +47 -31
- package/src/hooks/use-merged-refs.ts +64 -0
- package/src/hooks/use-object-value.ts +27 -23
- package/src/hooks/use-parent-window.ts +4 -2
- package/src/hooks/use-property.ts +11 -10
- package/src/hooks/use-setting.ts +20 -33
- package/src/hooks/use-signal.ts +37 -48
- package/src/index.ts +7 -8
- package/src/internal.ts +7 -18
- package/src/prop-types.ts +142 -0
- package/src/reconciler/apply-props.ts +233 -85
- package/src/reconciler/behaviors.ts +324 -0
- package/src/reconciler/child-routing.ts +202 -0
- package/src/reconciler/host-config.ts +239 -366
- package/src/reconciler/instance.ts +76 -24
- package/src/reconciler/metadata.ts +119 -0
- package/src/reconciler/node.ts +161 -0
- package/src/reconciler/placement.ts +255 -0
- package/src/reconciler/registry.ts +161 -0
- package/src/reconciler/root-element.ts +9 -11
- package/src/reconciler/root.ts +175 -0
- package/src/reconciler/signals.ts +113 -0
- package/src/reconciler/text.ts +407 -0
- package/src/utils/accessible-metadata.ts +23 -18
- package/src/utils/accessible-props.ts +279 -0
- package/src/utils/ref-prop.ts +30 -0
- package/src/utils/settings.ts +69 -0
- package/src/utils/variant.ts +368 -0
- package/dist/hooks/use-merge-refs.d.ts +0 -3
- package/dist/hooks/use-merge-refs.d.ts.map +0 -1
- package/dist/hooks/use-merge-refs.js +0 -48
- package/dist/hooks/use-merge-refs.js.map +0 -1
- package/dist/hooks/use-object-attachment.d.ts +0 -10
- package/dist/hooks/use-object-attachment.d.ts.map +0 -1
- package/dist/hooks/use-object-attachment.js +0 -24
- package/dist/hooks/use-object-attachment.js.map +0 -1
- package/dist/libraries/adw/dialog.d.ts.map +0 -1
- package/dist/libraries/adw/dialog.js +0 -25
- package/dist/libraries/adw/dialog.js.map +0 -1
- package/dist/libraries/adw/index.d.ts +0 -2
- package/dist/libraries/adw/index.d.ts.map +0 -1
- package/dist/libraries/adw/index.js +0 -2
- package/dist/libraries/adw/index.js.map +0 -1
- package/dist/reconciler/accessible.d.ts.map +0 -1
- package/dist/reconciler/accessible.js +0 -143
- package/dist/reconciler/accessible.js.map +0 -1
- package/dist/reconciler/commit-flush.d.ts +0 -3
- package/dist/reconciler/commit-flush.d.ts.map +0 -1
- package/dist/reconciler/commit-flush.js +0 -13
- package/dist/reconciler/commit-flush.js.map +0 -1
- package/dist/reconciler/container-attach.d.ts +0 -10
- package/dist/reconciler/container-attach.d.ts.map +0 -1
- package/dist/reconciler/container-attach.js +0 -216
- package/dist/reconciler/container-attach.js.map +0 -1
- package/dist/reconciler/content-rebuild.d.ts +0 -3
- package/dist/reconciler/content-rebuild.d.ts.map +0 -1
- package/dist/reconciler/content-rebuild.js +0 -15
- package/dist/reconciler/content-rebuild.js.map +0 -1
- package/dist/reconciler/dispatch.d.ts +0 -6
- package/dist/reconciler/dispatch.d.ts.map +0 -1
- package/dist/reconciler/dispatch.js +0 -61
- package/dist/reconciler/dispatch.js.map +0 -1
- package/dist/reconciler/element-prop-appliers.d.ts +0 -5
- package/dist/reconciler/element-prop-appliers.d.ts.map +0 -1
- package/dist/reconciler/element-prop-appliers.js +0 -104
- package/dist/reconciler/element-prop-appliers.js.map +0 -1
- package/dist/reconciler/element-props.d.ts +0 -25
- package/dist/reconciler/element-props.d.ts.map +0 -1
- package/dist/reconciler/element-props.js +0 -157
- package/dist/reconciler/element-props.js.map +0 -1
- package/dist/reconciler/label-text-rebuild.d.ts +0 -3
- package/dist/reconciler/label-text-rebuild.d.ts.map +0 -1
- package/dist/reconciler/label-text-rebuild.js +0 -22
- package/dist/reconciler/label-text-rebuild.js.map +0 -1
- package/dist/reconciler/portal.d.ts +0 -11
- package/dist/reconciler/portal.d.ts.map +0 -1
- package/dist/reconciler/portal.js +0 -20
- package/dist/reconciler/portal.js.map +0 -1
- package/dist/reconciler/reconciler-error-handler.d.ts +0 -7
- package/dist/reconciler/reconciler-error-handler.d.ts.map +0 -1
- package/dist/reconciler/reconciler-error-handler.js +0 -24
- package/dist/reconciler/reconciler-error-handler.js.map +0 -1
- package/dist/reconciler/reconciler-root.d.ts +0 -19
- package/dist/reconciler/reconciler-root.d.ts.map +0 -1
- package/dist/reconciler/reconciler-root.js +0 -24
- package/dist/reconciler/reconciler-root.js.map +0 -1
- package/dist/reconciler/reconciler.d.ts +0 -3
- package/dist/reconciler/reconciler.d.ts.map +0 -1
- package/dist/reconciler/reconciler.js +0 -12
- package/dist/reconciler/reconciler.js.map +0 -1
- package/dist/reconciler/render.d.ts +0 -23
- package/dist/reconciler/render.d.ts.map +0 -1
- package/dist/reconciler/render.js +0 -46
- package/dist/reconciler/render.js.map +0 -1
- package/dist/reconciler/signal-store.d.ts +0 -22
- package/dist/reconciler/signal-store.d.ts.map +0 -1
- package/dist/reconciler/signal-store.js +0 -84
- package/dist/reconciler/signal-store.js.map +0 -1
- package/dist/reconciler/state.d.ts +0 -36
- package/dist/reconciler/state.d.ts.map +0 -1
- package/dist/reconciler/state.js +0 -38
- package/dist/reconciler/state.js.map +0 -1
- package/dist/reconciler/text-buffer-controller.d.ts +0 -17
- package/dist/reconciler/text-buffer-controller.d.ts.map +0 -1
- package/dist/reconciler/text-buffer-controller.js +0 -102
- package/dist/reconciler/text-buffer-controller.js.map +0 -1
- package/dist/reconciler/text-buffer-rebuild.d.ts +0 -3
- package/dist/reconciler/text-buffer-rebuild.d.ts.map +0 -1
- package/dist/reconciler/text-buffer-rebuild.js +0 -7
- package/dist/reconciler/text-buffer-rebuild.js.map +0 -1
- package/dist/reconciler/text-node.d.ts +0 -7
- package/dist/reconciler/text-node.d.ts.map +0 -1
- package/dist/reconciler/text-node.js +0 -8
- package/dist/reconciler/text-node.js.map +0 -1
- package/dist/reconciler/types.d.ts +0 -5
- package/dist/reconciler/types.d.ts.map +0 -1
- package/dist/reconciler/types.js +0 -2
- package/dist/reconciler/types.js.map +0 -1
- package/dist/reconciler/visibility.d.ts +0 -6
- package/dist/reconciler/visibility.d.ts.map +0 -1
- package/dist/reconciler/visibility.js +0 -57
- package/dist/reconciler/visibility.js.map +0 -1
- package/dist/reconciler/wrapper-apply.d.ts +0 -6
- package/dist/reconciler/wrapper-apply.d.ts.map +0 -1
- package/dist/reconciler/wrapper-apply.js +0 -287
- package/dist/reconciler/wrapper-apply.js.map +0 -1
- package/dist/reconciler/wrapper-content.d.ts +0 -8
- package/dist/reconciler/wrapper-content.d.ts.map +0 -1
- package/dist/reconciler/wrapper-content.js +0 -19
- package/dist/reconciler/wrapper-content.js.map +0 -1
- package/dist/reconciler/wrapper-node.d.ts +0 -8
- package/dist/reconciler/wrapper-node.d.ts.map +0 -1
- package/dist/reconciler/wrapper-node.js +0 -4
- package/dist/reconciler/wrapper-node.js.map +0 -1
- package/dist/reconciler/wrapper-protocol.d.ts +0 -13
- package/dist/reconciler/wrapper-protocol.d.ts.map +0 -1
- package/dist/reconciler/wrapper-protocol.js +0 -20
- package/dist/reconciler/wrapper-protocol.js.map +0 -1
- package/dist/utils/create-element-component.d.ts +0 -4
- package/dist/utils/create-element-component.d.ts.map +0 -1
- package/dist/utils/create-element-component.js +0 -54
- package/dist/utils/create-element-component.js.map +0 -1
- package/dist/utils/gtype.d.ts +0 -16
- package/dist/utils/gtype.d.ts.map +0 -1
- package/dist/utils/gtype.js +0 -127
- package/dist/utils/gtype.js.map +0 -1
- package/dist/utils/notify-name.d.ts +0 -5
- package/dist/utils/notify-name.d.ts.map +0 -1
- package/dist/utils/notify-name.js +0 -6
- package/dist/utils/notify-name.js.map +0 -1
- package/dist/utils/object-prop.d.ts +0 -8
- package/dist/utils/object-prop.d.ts.map +0 -1
- package/dist/utils/object-prop.js +0 -9
- package/dist/utils/object-prop.js.map +0 -1
- package/dist/utils/settings-accessor.d.ts +0 -8
- package/dist/utils/settings-accessor.d.ts.map +0 -1
- package/dist/utils/settings-accessor.js +0 -69
- package/dist/utils/settings-accessor.js.map +0 -1
- package/dist/utils/wrapper-node-jsx.d.ts +0 -32
- package/dist/utils/wrapper-node-jsx.d.ts.map +0 -1
- package/dist/utils/wrapper-node-jsx.js +0 -2
- package/dist/utils/wrapper-node-jsx.js.map +0 -1
- package/src/hooks/use-merge-refs.ts +0 -53
- package/src/hooks/use-object-attachment.ts +0 -35
- package/src/libraries/adw/dialog.tsx +0 -34
- package/src/libraries/adw/index.ts +0 -1
- package/src/reconciler/accessible.ts +0 -232
- package/src/reconciler/commit-flush.ts +0 -13
- package/src/reconciler/container-attach.ts +0 -219
- package/src/reconciler/content-rebuild.ts +0 -19
- package/src/reconciler/dispatch.ts +0 -58
- package/src/reconciler/element-prop-appliers.ts +0 -110
- package/src/reconciler/element-props.ts +0 -192
- package/src/reconciler/label-text-rebuild.ts +0 -26
- package/src/reconciler/portal.ts +0 -28
- package/src/reconciler/reconciler-error-handler.ts +0 -29
- package/src/reconciler/reconciler-root.ts +0 -57
- package/src/reconciler/reconciler.ts +0 -13
- package/src/reconciler/render.ts +0 -61
- package/src/reconciler/signal-store.ts +0 -103
- package/src/reconciler/state.ts +0 -72
- package/src/reconciler/text-buffer-controller.ts +0 -107
- package/src/reconciler/text-buffer-rebuild.ts +0 -12
- package/src/reconciler/text-node.ts +0 -13
- package/src/reconciler/types.ts +0 -6
- package/src/reconciler/visibility.ts +0 -52
- package/src/reconciler/wrapper-apply.ts +0 -308
- package/src/reconciler/wrapper-content.ts +0 -24
- package/src/reconciler/wrapper-node.ts +0 -8
- package/src/reconciler/wrapper-protocol.ts +0 -32
- package/src/utils/create-element-component.ts +0 -77
- package/src/utils/gtype.ts +0 -166
- package/src/utils/notify-name.ts +0 -10
- package/src/utils/object-prop.ts +0 -13
- package/src/utils/settings-accessor.ts +0 -89
- package/src/utils/wrapper-node-jsx.ts +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-property.d.ts","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"use-property.d.ts","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,KAAK,UAAU,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAC7E,KAAK,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAE5E;;;;;;GAMG;AACH,iBAAS,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EACpE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,YAAY,EAAE,CAAC,GAAG,MAAM,GACzB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAElB;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { kebabCase } from "@gtkx/utils";
|
|
2
2
|
import { useObjectValue } from "./use-object-value.js";
|
|
3
3
|
/**
|
|
4
4
|
* Subscribes to a GObject property and returns its current value, re-rendering when the property changes.
|
|
@@ -7,7 +7,8 @@ import { useObjectValue } from "./use-object-value.js";
|
|
|
7
7
|
* @param propertyName The camelCase name of a readable property on the object.
|
|
8
8
|
* @returns The current property value, or `undefined` when the object is not resolved.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
return useObjectValue(object,
|
|
10
|
+
function useProperty(object, propertyName) {
|
|
11
|
+
return useObjectValue(object, `notify::${kebabCase(propertyName)}`, (obj) => obj?.[propertyName]);
|
|
12
12
|
}
|
|
13
|
+
export { useProperty };
|
|
13
14
|
//# sourceMappingURL=use-property.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-property.js","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-property.js","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;;;;;GAMG;AACH,SAAS,WAAW,CAChB,MAAkB,EAClB,YAAwB;IAExB,OAAO,cAAc,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACtG,CAAC;AAED,OAAO,EAAE,WAAW,EAAqB,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport { kebabCase } from \"@gtkx/utils\";\nimport type { RefProp } from \"../utils/ref-prop.js\";\nimport { useObjectValue } from \"./use-object-value.js\";\n\ntype Properties<T extends GObject.Object> = NonNullable<T[\"__properties__\"]>;\ntype PropertyName<T extends GObject.Object> = keyof Properties<T> & keyof T;\n\n/**\n * Subscribes to a GObject property and returns its current value, re-rendering when the property changes.\n *\n * @param object The GObject (or ref to one) whose property to observe.\n * @param propertyName The camelCase name of a readable property on the object.\n * @returns The current property value, or `undefined` when the object is not resolved.\n */\nfunction useProperty<T extends GObject.Object, P extends PropertyName<T>>(\n object: RefProp<T>,\n propertyName: P & string,\n): T[P] | undefined {\n return useObjectValue(object, `notify::${kebabCase(propertyName)}`, (obj) => obj?.[propertyName]);\n}\n\nexport { useProperty, type PropertyName };\n"]}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import * as Gio from "@gtkx/gi/gio";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type SchemaRef<K extends object = Record<string, unknown>> = {
|
|
6
|
-
id: string;
|
|
7
|
-
/** The schema's object path, or `null` to use the schema's default path. */
|
|
8
|
-
path: string | null;
|
|
9
|
-
/** Maps each typed key of `K` to its corresponding GSettings key name. */
|
|
10
|
-
keys: {
|
|
11
|
-
[P in keyof K]: string;
|
|
12
|
-
};
|
|
13
|
-
/** Phantom field carrying the value type `K`; never populated at runtime. */
|
|
14
|
-
__keys__?: K;
|
|
15
|
-
};
|
|
16
|
-
export declare const useSettingsInstance: ({ id, path }: Pick<SchemaRef, "id" | "path">) => Gio.Settings;
|
|
2
|
+
import { type SettingsSchema, type SettingsSchemaKeys, type SettingValue } from "../utils/settings.js";
|
|
3
|
+
type UseSettingsProps<K extends SettingsSchemaKeys> = Pick<SettingsSchema<K>, "id" | "path">;
|
|
4
|
+
declare const useSettings: <K extends SettingsSchemaKeys>({ id, path }: UseSettingsProps<K>) => Gio.Settings;
|
|
17
5
|
/**
|
|
18
6
|
* Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.
|
|
19
7
|
*
|
|
@@ -21,5 +9,6 @@ export declare const useSettingsInstance: ({ id, path }: Pick<SchemaRef, "id" |
|
|
|
21
9
|
* @param key The key within the schema to read and write.
|
|
22
10
|
* @returns A tuple of the current value and a setter that persists a new value.
|
|
23
11
|
*/
|
|
24
|
-
|
|
12
|
+
declare function useSetting<K extends SettingsSchemaKeys, P extends keyof K>(schema: SettingsSchema<K>, key: P & string): [SettingValue<K, P>, (value: SettingValue<K, P>) => void];
|
|
13
|
+
export { useSettings, useSetting };
|
|
25
14
|
//# sourceMappingURL=use-setting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-setting.d.ts","sourceRoot":"","sources":["../../src/hooks/use-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"use-setting.d.ts","sourceRoot":"","sources":["../../src/hooks/use-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EAEH,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACpB,MAAM,sBAAsB,CAAC;AAG9B,KAAK,gBAAgB,CAAC,CAAC,SAAS,kBAAkB,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;AAE7F,QAAA,MAAM,WAAW,GAAI,CAAC,SAAS,kBAAkB,EAAE,cAAc,gBAAgB,CAAC,CAAC,CAAC,KAAG,GAAG,CAAC,QACU,CAAC;AAEtG;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,CAAC,SAAS,kBAAkB,EAAE,CAAC,SAAS,MAAM,CAAC,EAC/D,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EACzB,GAAG,EAAE,CAAC,GAAG,MAAM,GAChB,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAM3D;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import * as Gio from "@gtkx/gi/gio";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { resolveSettingAccessor, } from "../utils/settings.js";
|
|
4
4
|
import { useObjectValue } from "./use-object-value.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const useSettings = ({ id, path }) => useMemo(() => (path ? new Gio.Settings({ schema: id, path }) : Gio.Settings.new(id)), [id, path]);
|
|
6
|
+
/**
|
|
7
|
+
* Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.
|
|
8
|
+
*
|
|
9
|
+
* @param schema The schema reference identifying the settings backend.
|
|
10
|
+
* @param key The key within the schema to read and write.
|
|
11
|
+
* @returns A tuple of the current value and a setter that persists a new value.
|
|
12
|
+
*/
|
|
13
|
+
function useSetting(schema, key) {
|
|
14
|
+
const settings = useSettings({ id: schema.id, path: schema.path });
|
|
15
|
+
const accessor = resolveSettingAccessor(settings, schema, key);
|
|
16
|
+
const value = useObjectValue(settings, `changed::${key}`, () => accessor.get());
|
|
17
|
+
return [value, accessor.set];
|
|
14
18
|
}
|
|
19
|
+
export { useSettings, useSetting };
|
|
15
20
|
//# sourceMappingURL=use-setting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-setting.js","sourceRoot":"","sources":["../../src/hooks/use-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-setting.js","sourceRoot":"","sources":["../../src/hooks/use-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACH,sBAAsB,GAIzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,WAAW,GAAG,CAA+B,EAAE,EAAE,EAAE,IAAI,EAAuB,EAAgB,EAAE,CAClG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtG;;;;;;GAMG;AACH,SAAS,UAAU,CACf,MAAyB,EACzB,GAAe;IAEf,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;IAEhF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import * as Gio from \"@gtkx/gi/gio\";\nimport { useMemo } from \"react\";\nimport {\n resolveSettingAccessor,\n type SettingsSchema,\n type SettingsSchemaKeys,\n type SettingValue,\n} from \"../utils/settings.js\";\nimport { useObjectValue } from \"./use-object-value.js\";\n\ntype UseSettingsProps<K extends SettingsSchemaKeys> = Pick<SettingsSchema<K>, \"id\" | \"path\">;\n\nconst useSettings = <K extends SettingsSchemaKeys>({ id, path }: UseSettingsProps<K>): Gio.Settings =>\n useMemo(() => (path ? new Gio.Settings({ schema: id, path }) : Gio.Settings.new(id)), [id, path]);\n\n/**\n * Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.\n *\n * @param schema The schema reference identifying the settings backend.\n * @param key The key within the schema to read and write.\n * @returns A tuple of the current value and a setter that persists a new value.\n */\nfunction useSetting<K extends SettingsSchemaKeys, P extends keyof K>(\n schema: SettingsSchema<K>,\n key: P & string,\n): [SettingValue<K, P>, (value: SettingValue<K, P>) => void] {\n const settings = useSettings({ id: schema.id, path: schema.path });\n const accessor = resolveSettingAccessor(settings, schema, key);\n const value = useObjectValue(settings, `changed::${key}`, () => accessor.get());\n\n return [value, accessor.set];\n}\n\nexport { useSettings, useSetting };\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as GObject from "@gtkx/gi/gobject";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type { SignalHandler } from "@gtkx/runtime";
|
|
3
|
+
import { type RefProp } from "../utils/ref-prop.js";
|
|
4
|
+
type Signals<T extends GObject.Object> = NonNullable<T["__signals__"]>;
|
|
5
|
+
type SignalName<T extends GObject.Object> = keyof Signals<T> | `${keyof Signals<T> & string}::${string}`;
|
|
6
|
+
type TypedSignalHandler<T extends GObject.Object, S extends string> = S extends keyof Signals<T> ? Signals<T>[S] : S extends `${infer TBase}::${string}` ? TBase extends keyof Signals<T> ? Signals<T>[TBase] : SignalHandler : SignalHandler;
|
|
7
7
|
type UseSignalOptions = {
|
|
8
8
|
after?: boolean;
|
|
9
9
|
immediate?: boolean;
|
|
@@ -11,11 +11,14 @@ type UseSignalOptions = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.
|
|
13
13
|
*
|
|
14
|
+
* Each emission runs the handler from the latest render, so it does not have to be stable and a
|
|
15
|
+
* changing handler never reconnects the signal.
|
|
16
|
+
*
|
|
14
17
|
* @param object The GObject (or ref to one) to connect to.
|
|
15
18
|
* @param signal The signal name, optionally with a detail suffix.
|
|
16
19
|
* @param handler The callback invoked when the signal is emitted.
|
|
17
20
|
* @param options Connection options such as running after the default handler or invoking immediately.
|
|
18
21
|
*/
|
|
19
|
-
|
|
20
|
-
export {};
|
|
22
|
+
declare function useSignal<T extends GObject.Object, S extends SignalName<T> & string>(object: RefProp<T>, signal: S, handler: TypedSignalHandler<T, S>, { after, immediate }?: UseSignalOptions): void;
|
|
23
|
+
export { useSignal, type SignalName, type TypedSignalHandler };
|
|
21
24
|
//# sourceMappingURL=use-signal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,sBAAsB,CAAC;AAEpE,KAAK,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AACvE,KAAK,UAAU,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,MAAM,EAAE,CAAC;AAEzG,KAAK,kBAAkB,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,GAC1F,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACb,CAAC,SAAS,GAAG,MAAM,KAAK,KAAK,MAAM,EAAE,GACjC,KAAK,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GACjB,aAAa,GACjB,aAAa,CAAC;AAExB,KAAK,gBAAgB,GAAG;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,iBAAS,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,EACzE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EACjC,EAAE,KAAa,EAAE,SAAiB,EAAE,GAAE,gBAAqB,GAC5D,IAAI,CAoBN;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,CAAC"}
|
package/dist/hooks/use-signal.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useEffectEvent, useLayoutEffect } from "react";
|
|
2
|
+
import { resolveRefProp } from "../utils/ref-prop.js";
|
|
3
|
+
/**
|
|
4
|
+
* Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.
|
|
5
|
+
*
|
|
6
|
+
* Each emission runs the handler from the latest render, so it does not have to be stable and a
|
|
7
|
+
* changing handler never reconnects the signal.
|
|
8
|
+
*
|
|
9
|
+
* @param object The GObject (or ref to one) to connect to.
|
|
10
|
+
* @param signal The signal name, optionally with a detail suffix.
|
|
11
|
+
* @param handler The callback invoked when the signal is emitted.
|
|
12
|
+
* @param options Connection options such as running after the default handler or invoking immediately.
|
|
13
|
+
*/
|
|
14
|
+
function useSignal(object, signal, handler, { after = false, immediate = false } = {}) {
|
|
15
|
+
const emit = useEffectEvent(handler);
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
const resolved = resolveRefProp(object);
|
|
18
|
+
if (!resolved) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
resolved.on(signal, emit, after);
|
|
22
|
+
if (immediate) {
|
|
23
|
+
emit();
|
|
24
|
+
}
|
|
25
|
+
return () => {
|
|
26
|
+
resolved.off(signal, emit);
|
|
27
|
+
};
|
|
28
|
+
}, [object, signal, after, immediate]);
|
|
19
29
|
}
|
|
30
|
+
export { useSignal };
|
|
20
31
|
//# sourceMappingURL=use-signal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkBpE;;;;;;;;;;GAUG;AACH,SAAS,SAAS,CACd,MAAkB,EAClB,MAAS,EACT,OAAiC,EACjC,EAAE,KAAK,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,KAAuB,EAAE;IAE3D,MAAM,IAAI,GAAG,cAAc,CAAC,OAAwB,CAAC,CAAC;IAEtD,eAAe,CAAC,GAAG,EAAE;QACjB,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO;QACX,CAAC;QAED,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAEjC,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,EAAE,CAAC;QACX,CAAC;QAED,OAAO,GAAG,EAAE;YACR,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,OAAO,EAAE,SAAS,EAA4C,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { SignalHandler } from \"@gtkx/runtime\";\nimport { useEffectEvent, useLayoutEffect } from \"react\";\nimport { type RefProp, resolveRefProp } from \"../utils/ref-prop.js\";\n\ntype Signals<T extends GObject.Object> = NonNullable<T[\"__signals__\"]>;\ntype SignalName<T extends GObject.Object> = keyof Signals<T> | `${keyof Signals<T> & string}::${string}`;\n\ntype TypedSignalHandler<T extends GObject.Object, S extends string> = S extends keyof Signals<T>\n ? Signals<T>[S]\n : S extends `${infer TBase}::${string}`\n ? TBase extends keyof Signals<T>\n ? Signals<T>[TBase]\n : SignalHandler\n : SignalHandler;\n\ntype UseSignalOptions = {\n after?: boolean;\n immediate?: boolean;\n};\n\n/**\n * Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.\n *\n * Each emission runs the handler from the latest render, so it does not have to be stable and a\n * changing handler never reconnects the signal.\n *\n * @param object The GObject (or ref to one) to connect to.\n * @param signal The signal name, optionally with a detail suffix.\n * @param handler The callback invoked when the signal is emitted.\n * @param options Connection options such as running after the default handler or invoking immediately.\n */\nfunction useSignal<T extends GObject.Object, S extends SignalName<T> & string>(\n object: RefProp<T>,\n signal: S,\n handler: TypedSignalHandler<T, S>,\n { after = false, immediate = false }: UseSignalOptions = {},\n): void {\n const emit = useEffectEvent(handler as SignalHandler);\n\n useLayoutEffect(() => {\n const resolved = resolveRefProp(object);\n\n if (!resolved) {\n return;\n }\n\n resolved.on(signal, emit, after);\n\n if (immediate) {\n emit();\n }\n\n return () => {\n resolved.off(signal, emit);\n };\n }, [object, signal, after, immediate]);\n}\n\nexport { useSignal, type SignalName, type TypedSignalHandler };\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
export type { ElementProp } from "@gtkx/config";
|
|
1
|
+
import "./bootstrap.js";
|
|
3
2
|
export { useApplication } from "./hooks/use-application.js";
|
|
4
3
|
export { useBindSetting } from "./hooks/use-bind-setting.js";
|
|
5
4
|
export { useParentWindow } from "./hooks/use-parent-window.js";
|
|
6
5
|
export { useProperty } from "./hooks/use-property.js";
|
|
7
|
-
export {
|
|
6
|
+
export { useSetting } from "./hooks/use-setting.js";
|
|
8
7
|
export { useSignal } from "./hooks/use-signal.js";
|
|
9
|
-
export type {
|
|
10
|
-
export { createPortal } from "./reconciler/portal.js";
|
|
11
|
-
export { createRoot, quit, type Root } from "./reconciler/render.js";
|
|
8
|
+
export type { MenuItem, VflConstraints } from "./prop-types.js";
|
|
12
9
|
export { type RootElement, rootElement } from "./reconciler/root-element.js";
|
|
13
|
-
export type
|
|
14
|
-
export type {
|
|
10
|
+
export { createPortal, createRoot, quit, type Root } from "./reconciler/root.js";
|
|
11
|
+
export type { AccessibleProps } from "./utils/accessible-props.js";
|
|
12
|
+
export type { RefProp } from "./utils/ref-prop.js";
|
|
13
|
+
export type { SettingsSchema, SettingsSchemaKeys, SettingValue } from "./utils/settings.js";
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./bootstrap.js";
|
|
2
2
|
export { useApplication } from "./hooks/use-application.js";
|
|
3
3
|
export { useBindSetting } from "./hooks/use-bind-setting.js";
|
|
4
4
|
export { useParentWindow } from "./hooks/use-parent-window.js";
|
|
5
5
|
export { useProperty } from "./hooks/use-property.js";
|
|
6
6
|
export { useSetting } from "./hooks/use-setting.js";
|
|
7
7
|
export { useSignal } from "./hooks/use-signal.js";
|
|
8
|
-
export { createPortal } from "./reconciler/portal.js";
|
|
9
|
-
export { createRoot, quit } from "./reconciler/render.js";
|
|
10
8
|
export { rootElement } from "./reconciler/root-element.js";
|
|
9
|
+
export { createPortal, createRoot, quit } from "./reconciler/root.js";
|
|
11
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAoB,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,sBAAsB,CAAC","sourcesContent":["import \"./bootstrap.js\";\n\nexport { useApplication } from \"./hooks/use-application.js\";\nexport { useBindSetting } from \"./hooks/use-bind-setting.js\";\nexport { useParentWindow } from \"./hooks/use-parent-window.js\";\nexport { useProperty } from \"./hooks/use-property.js\";\nexport { useSetting } from \"./hooks/use-setting.js\";\nexport { useSignal } from \"./hooks/use-signal.js\";\nexport type { MenuItem, VflConstraints } from \"./prop-types.js\";\nexport { type RootElement, rootElement } from \"./reconciler/root-element.js\";\nexport { createPortal, createRoot, quit, type Root } from \"./reconciler/root.js\";\nexport type { AccessibleProps } from \"./utils/accessible-props.js\";\nexport type { RefProp } from \"./utils/ref-prop.js\";\nexport type { SettingsSchema, SettingsSchemaKeys, SettingValue } from \"./utils/settings.js\";\n"]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import "./bootstrap.js";
|
|
1
2
|
export { createApplicationComponent } from "./components/application.js";
|
|
3
|
+
export { createElementComponent } from "./components/element.js";
|
|
2
4
|
export { createWindowComponent } from "./components/window.js";
|
|
3
5
|
export { ApplicationContext } from "./hooks/use-application.js";
|
|
4
|
-
export {
|
|
5
|
-
export { useObjectAttachment } from "./hooks/use-object-attachment.js";
|
|
6
|
+
export { useMergedRef } from "./hooks/use-merged-refs.js";
|
|
6
7
|
export { useObjectValue } from "./hooks/use-object-value.js";
|
|
7
|
-
export
|
|
8
|
-
export { createReconcilerRoot, type ReconcilerRoot } from "./reconciler/reconciler-root.js";
|
|
8
|
+
export type * from "./prop-types.js";
|
|
9
9
|
export { isRootElement } from "./reconciler/root-element.js";
|
|
10
|
-
export {
|
|
10
|
+
export { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
|
|
11
11
|
export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
|
|
12
|
-
export {
|
|
13
|
-
export { type ObjectProp, resolveObjectProp } from "./utils/object-prop.js";
|
|
12
|
+
export { type RefProp, resolveRefProp } from "./utils/ref-prop.js";
|
|
14
13
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import "./bootstrap.js";
|
|
1
2
|
export { createApplicationComponent } from "./components/application.js";
|
|
3
|
+
export { createElementComponent } from "./components/element.js";
|
|
2
4
|
export { createWindowComponent } from "./components/window.js";
|
|
3
5
|
export { ApplicationContext } from "./hooks/use-application.js";
|
|
4
|
-
export {
|
|
5
|
-
export { useObjectAttachment } from "./hooks/use-object-attachment.js";
|
|
6
|
+
export { useMergedRef } from "./hooks/use-merged-refs.js";
|
|
6
7
|
export { useObjectValue } from "./hooks/use-object-value.js";
|
|
7
|
-
export { setReconcilerErrorHandler } from "./reconciler/reconciler-error-handler.js";
|
|
8
|
-
export { createReconcilerRoot } from "./reconciler/reconciler-root.js";
|
|
9
8
|
export { isRootElement } from "./reconciler/root-element.js";
|
|
10
|
-
export {
|
|
9
|
+
export { createReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
|
|
11
10
|
export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
|
|
12
|
-
export {
|
|
13
|
-
export { resolveObjectProp } from "./utils/object-prop.js";
|
|
11
|
+
export { resolveRefProp } from "./utils/ref-prop.js";
|
|
14
12
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAuB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAgB,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["import \"./bootstrap.js\";\n\nexport { createApplicationComponent } from \"./components/application.js\";\nexport { createElementComponent } from \"./components/element.js\";\nexport { createWindowComponent } from \"./components/window.js\";\nexport { ApplicationContext } from \"./hooks/use-application.js\";\nexport { useMergedRef } from \"./hooks/use-merged-refs.js\";\nexport { useObjectValue } from \"./hooks/use-object-value.js\";\nexport type * from \"./prop-types.js\";\nexport { isRootElement } from \"./reconciler/root-element.js\";\nexport { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from \"./reconciler/root.js\";\nexport { getAccessibleMetadata } from \"./utils/accessible-metadata.js\";\nexport { type RefProp, resolveRefProp } from \"./utils/ref-prop.js\";\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type * as Gdk from "@gtkx/gi/gdk";
|
|
2
|
+
import type * as GObject from "@gtkx/gi/gobject";
|
|
3
|
+
import type * as Gtk from "@gtkx/gi/gtk";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
/** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */
|
|
6
|
+
type MenuItem = {
|
|
7
|
+
label?: string | null;
|
|
8
|
+
action?: string | null;
|
|
9
|
+
submenu?: MenuItem[];
|
|
10
|
+
section?: MenuItem[];
|
|
11
|
+
};
|
|
12
|
+
/** One Visual Format Language block applied to a `Gtk.ConstraintLayout`. */
|
|
13
|
+
type VflConstraints = {
|
|
14
|
+
lines: string[];
|
|
15
|
+
hspacing?: number;
|
|
16
|
+
vspacing?: number;
|
|
17
|
+
views?: Map<string, Gtk.ConstraintTarget>;
|
|
18
|
+
};
|
|
19
|
+
/** One mark on a `Gtk.Scale`. */
|
|
20
|
+
type ScaleMark = {
|
|
21
|
+
value?: number;
|
|
22
|
+
position: Gtk.PositionType;
|
|
23
|
+
markup?: string | null;
|
|
24
|
+
};
|
|
25
|
+
/** One labelled offset on a `Gtk.LevelBar`. */
|
|
26
|
+
type LevelBarOffset = {
|
|
27
|
+
name: string;
|
|
28
|
+
value?: number;
|
|
29
|
+
};
|
|
30
|
+
/** One credit section on a `Gtk.AboutDialog`. */
|
|
31
|
+
type CreditSection = {
|
|
32
|
+
sectionName: string;
|
|
33
|
+
people: string[];
|
|
34
|
+
};
|
|
35
|
+
/** One accelerator binding on a `Gtk.Application`. */
|
|
36
|
+
type ActionAccel = {
|
|
37
|
+
detailedActionName: string;
|
|
38
|
+
accels: string[];
|
|
39
|
+
};
|
|
40
|
+
/** The drag icon of a `Gtk.DragSource`, with its hotspot. */
|
|
41
|
+
type DragSourceIcon = {
|
|
42
|
+
paintable?: Gdk.Paintable | null;
|
|
43
|
+
hotX?: number;
|
|
44
|
+
hotY?: number;
|
|
45
|
+
};
|
|
46
|
+
/** Props of an element that accepts children. */
|
|
47
|
+
type ChildrenProps = {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
type GtkWidgetProps = {
|
|
51
|
+
controllers?: ReactNode | null | undefined;
|
|
52
|
+
actionGroups?: ReactNode | null | undefined;
|
|
53
|
+
} & ChildrenProps;
|
|
54
|
+
type GActionGroupProps = {
|
|
55
|
+
prefix?: string | null | undefined;
|
|
56
|
+
};
|
|
57
|
+
type GActionMapProps = {
|
|
58
|
+
actions?: ReactNode | null | undefined;
|
|
59
|
+
};
|
|
60
|
+
type GMenuProps = {
|
|
61
|
+
items?: MenuItem[] | null | undefined;
|
|
62
|
+
};
|
|
63
|
+
type GtkShortcutControllerProps = {
|
|
64
|
+
shortcuts?: ReactNode | null | undefined;
|
|
65
|
+
};
|
|
66
|
+
type GtkOverlayProps = {
|
|
67
|
+
overlays?: ReactNode | null | undefined;
|
|
68
|
+
} & ChildrenProps;
|
|
69
|
+
type GtkConstraintLayoutProps = {
|
|
70
|
+
constraints?: ReactNode | null | undefined;
|
|
71
|
+
guides?: ReactNode | null | undefined;
|
|
72
|
+
vfl?: VflConstraints[] | null | undefined;
|
|
73
|
+
};
|
|
74
|
+
/** Props of `GtkTextChildAnchor`, which embeds either a child widget or a paintable in a text buffer. */
|
|
75
|
+
type GtkTextChildAnchorProps = {
|
|
76
|
+
paintable?: Gdk.Paintable | null | undefined;
|
|
77
|
+
} & ChildrenProps;
|
|
78
|
+
type GtkHeaderBarProps = {
|
|
79
|
+
start?: ReactNode | null | undefined;
|
|
80
|
+
end?: ReactNode | null | undefined;
|
|
81
|
+
};
|
|
82
|
+
type GtkScaleProps = {
|
|
83
|
+
marks?: ScaleMark[] | null | undefined;
|
|
84
|
+
};
|
|
85
|
+
type GtkCalendarProps = {
|
|
86
|
+
markedDays?: number[] | null | undefined;
|
|
87
|
+
};
|
|
88
|
+
type GtkLevelBarProps = {
|
|
89
|
+
offsets?: LevelBarOffset[] | null | undefined;
|
|
90
|
+
};
|
|
91
|
+
type GtkSizeGroupProps = {
|
|
92
|
+
widgets?: Gtk.Widget[] | null | undefined;
|
|
93
|
+
};
|
|
94
|
+
type GtkAboutDialogProps = {
|
|
95
|
+
creditSections?: CreditSection[] | null | undefined;
|
|
96
|
+
};
|
|
97
|
+
type GtkApplicationProps = {
|
|
98
|
+
actionAccels?: ActionAccel[] | null | undefined;
|
|
99
|
+
} & ChildrenProps;
|
|
100
|
+
type GtkDropTargetProps = {
|
|
101
|
+
types?: GObject.Type[] | null | undefined;
|
|
102
|
+
};
|
|
103
|
+
type GtkDrawingAreaProps = {
|
|
104
|
+
drawFunc?: Gtk.DrawingAreaDrawFunc | null | undefined;
|
|
105
|
+
};
|
|
106
|
+
type GtkDragSourceProps = {
|
|
107
|
+
icon?: DragSourceIcon | null | undefined;
|
|
108
|
+
};
|
|
109
|
+
export { type MenuItem, type VflConstraints, type ScaleMark, type LevelBarOffset, type CreditSection, type ActionAccel, type DragSourceIcon, type ChildrenProps, type GtkWidgetProps, type GActionGroupProps, type GActionMapProps, type GMenuProps, type GtkShortcutControllerProps, type GtkOverlayProps, type GtkTextChildAnchorProps, type GtkConstraintLayoutProps, type GtkHeaderBarProps, type GtkScaleProps, type GtkCalendarProps, type GtkLevelBarProps, type GtkSizeGroupProps, type GtkAboutDialogProps, type GtkApplicationProps, type GtkDropTargetProps, type GtkDrawingAreaProps, type GtkDragSourceProps, };
|
|
110
|
+
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,yFAAyF;AACzF,KAAK,QAAQ,GAAG;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,4EAA4E;AAC5E,KAAK,cAAc,GAAG;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7C,CAAC;AAEF,iCAAiC;AACjC,KAAK,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AACxF,+CAA+C;AAC/C,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvD,iDAAiD;AACjD,KAAK,aAAa,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAC/D,sDAAsD;AACtD,KAAK,WAAW,GAAG;IAAE,kBAAkB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AACpE,6DAA6D;AAC7D,KAAK,cAAc,GAAG;IAAE,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,iDAAiD;AACjD,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,KAAK,cAAc,GAAG;IAClB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/C,GAAG,aAAa,CAAC;AAElB,KAAK,iBAAiB,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,KAAK,UAAU,GAAG;IACd,KAAK,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CAC3C,GAAG,aAAa,CAAC;AAElB,KAAK,wBAAwB,GAAG;IAC5B,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,yGAAyG;AACzG,KAAK,uBAAuB,GAAG;IAC3B,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CAChD,GAAG,aAAa,CAAC;AAElB,KAAK,iBAAiB,GAAG;IACrB,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACpB,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACrB,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,cAAc,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CACvD,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,YAAY,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CACnD,GAAG,aAAa,CAAC;AAElB,KAAK,kBAAkB,GAAG;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;CACzD,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-types.js","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AAkHA,OAAO,EA2BN,CAAC","sourcesContent":["import type * as Gdk from \"@gtkx/gi/gdk\";\nimport type * as GObject from \"@gtkx/gi/gobject\";\nimport type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ReactNode } from \"react\";\n\n/** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */\ntype MenuItem = {\n label?: string | null;\n action?: string | null;\n submenu?: MenuItem[];\n section?: MenuItem[];\n};\n\n/** One Visual Format Language block applied to a `Gtk.ConstraintLayout`. */\ntype VflConstraints = {\n lines: string[];\n hspacing?: number;\n vspacing?: number;\n views?: Map<string, Gtk.ConstraintTarget>;\n};\n\n/** One mark on a `Gtk.Scale`. */\ntype ScaleMark = { value?: number; position: Gtk.PositionType; markup?: string | null };\n/** One labelled offset on a `Gtk.LevelBar`. */\ntype LevelBarOffset = { name: string; value?: number };\n/** One credit section on a `Gtk.AboutDialog`. */\ntype CreditSection = { sectionName: string; people: string[] };\n/** One accelerator binding on a `Gtk.Application`. */\ntype ActionAccel = { detailedActionName: string; accels: string[] };\n/** The drag icon of a `Gtk.DragSource`, with its hotspot. */\ntype DragSourceIcon = { paintable?: Gdk.Paintable | null; hotX?: number; hotY?: number };\n\n/** Props of an element that accepts children. */\ntype ChildrenProps = {\n children?: ReactNode;\n};\n\ntype GtkWidgetProps = {\n controllers?: ReactNode | null | undefined;\n actionGroups?: ReactNode | null | undefined;\n} & ChildrenProps;\n\ntype GActionGroupProps = {\n prefix?: string | null | undefined;\n};\n\ntype GActionMapProps = {\n actions?: ReactNode | null | undefined;\n};\n\ntype GMenuProps = {\n items?: MenuItem[] | null | undefined;\n};\n\ntype GtkShortcutControllerProps = {\n shortcuts?: ReactNode | null | undefined;\n};\n\ntype GtkOverlayProps = {\n overlays?: ReactNode | null | undefined;\n} & ChildrenProps;\n\ntype GtkConstraintLayoutProps = {\n constraints?: ReactNode | null | undefined;\n guides?: ReactNode | null | undefined;\n vfl?: VflConstraints[] | null | undefined;\n};\n\n/** Props of `GtkTextChildAnchor`, which embeds either a child widget or a paintable in a text buffer. */\ntype GtkTextChildAnchorProps = {\n paintable?: Gdk.Paintable | null | undefined;\n} & ChildrenProps;\n\ntype GtkHeaderBarProps = {\n start?: ReactNode | null | undefined;\n end?: ReactNode | null | undefined;\n};\n\ntype GtkScaleProps = {\n marks?: ScaleMark[] | null | undefined;\n};\n\ntype GtkCalendarProps = {\n markedDays?: number[] | null | undefined;\n};\n\ntype GtkLevelBarProps = {\n offsets?: LevelBarOffset[] | null | undefined;\n};\n\ntype GtkSizeGroupProps = {\n widgets?: Gtk.Widget[] | null | undefined;\n};\n\ntype GtkAboutDialogProps = {\n creditSections?: CreditSection[] | null | undefined;\n};\n\ntype GtkApplicationProps = {\n actionAccels?: ActionAccel[] | null | undefined;\n} & ChildrenProps;\n\ntype GtkDropTargetProps = {\n types?: GObject.Type[] | null | undefined;\n};\n\ntype GtkDrawingAreaProps = {\n drawFunc?: Gtk.DrawingAreaDrawFunc | null | undefined;\n};\n\ntype GtkDragSourceProps = {\n icon?: DragSourceIcon | null | undefined;\n};\n\nexport {\n type MenuItem,\n type VflConstraints,\n type ScaleMark,\n type LevelBarOffset,\n type CreditSection,\n type ActionAccel,\n type DragSourceIcon,\n type ChildrenProps,\n type GtkWidgetProps,\n type GActionGroupProps,\n type GActionMapProps,\n type GMenuProps,\n type GtkShortcutControllerProps,\n type GtkOverlayProps,\n type GtkTextChildAnchorProps,\n type GtkConstraintLayoutProps,\n type GtkHeaderBarProps,\n type GtkScaleProps,\n type GtkCalendarProps,\n type GtkLevelBarProps,\n type GtkSizeGroupProps,\n type GtkAboutDialogProps,\n type GtkApplicationProps,\n type GtkDropTargetProps,\n type GtkDrawingAreaProps,\n type GtkDragSourceProps,\n};\n"]}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { Props } from "./registry.js";
|
|
2
|
+
import { type ElementNode, type SignalTarget } from "./node.js";
|
|
3
|
+
declare const assertConstructOnlyUnchanged: (typeName: string, prev: Props, next: Props) => void;
|
|
4
|
+
declare const markFlush: (node: ElementNode) => void;
|
|
5
|
+
declare const flushBehaviors: () => void;
|
|
6
|
+
declare const mountBehaviors: (node: ElementNode) => void;
|
|
7
|
+
declare const unmountBehaviors: (node: ElementNode) => void;
|
|
8
|
+
declare const applyElementProps: (node: ElementNode, prev: Props, next: Props) => void;
|
|
9
|
+
declare const applyAdoptedProps: (target: SignalTarget, prev: Props, next: Props) => void;
|
|
10
|
+
export { markFlush, flushBehaviors, mountBehaviors, unmountBehaviors, applyElementProps, applyAdoptedProps, assertConstructOnlyUnchanged, };
|
|
8
11
|
//# sourceMappingURL=apply-props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-props.d.ts","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-props.d.ts","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,KAAK,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,KAAK,WAAW,EAAsB,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AA2GpF,QAAA,MAAM,4BAA4B,GAAI,UAAU,MAAM,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IAUlF,CAAC;AAmEF,QAAA,MAAM,SAAS,GAAI,MAAM,WAAW,KAAG,IAItC,CAAC;AAQF,QAAA,MAAM,cAAc,QAAO,IAI1B,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,MAAM,WAAW,KAAG,IAM3C,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,MAAM,WAAW,KAAG,IAE7C,CAAC;AAQF,QAAA,MAAM,iBAAiB,GAAI,MAAM,WAAW,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IASxE,CAAC;AAIF,QAAA,MAAM,iBAAiB,GAAI,QAAQ,YAAY,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IAc3E,CAAC;AAEF,OAAO,EACH,SAAS,EACT,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,GAC/B,CAAC"}
|