@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
|
@@ -0,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EAAE,KAAiB;IACtD,OAAO,MAAM,CAAC,gBAAgB,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;AACpE,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAY,EAAE;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAE5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,SAAS,cAAc,CAAC,IAAc,EAAE,IAAc;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC;IAEjC,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,OAAO;IACX,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,OAAO;IACX,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACnC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gio from \"@gtkx/gi/gio\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport type {\n ActionAccel,\n CreditSection,\n DragSourceIcon,\n LevelBarOffset,\n MenuItem,\n ScaleMark,\n VflConstraints,\n} from \"./prop-types.js\";\nimport { BUILTIN_ELEMENTS, SINGLE_CHILD_TYPES } from \"./element-config.js\";\nimport {\n addRemoveSlot,\n adoptedChildrenSlot,\n boxSlot,\n childSetterSlot,\n controlledText,\n deferred,\n list,\n slot,\n value,\n wrappingIndexedSlot,\n} from \"./reconciler/behaviors.js\";\nimport { type ElementConfig, forTypes, registerElements } from \"./reconciler/registry.js\";\n\n/** The runtime half of the built-in element configuration: the behaviors bound to each GObject type. */\nconst BUILTIN_BEHAVIORS: Record<string, ElementConfig<never>> = {\n ...forTypes(SINGLE_CHILD_TYPES, {\n behaviors: [childSetterSlot()],\n }),\n ...forTypes([\"GtkHeaderBar\", \"GtkActionBar\"], {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Gtk.HeaderBar | Gtk.ActionBar>(\n \"start\",\n \"GtkWidget\",\n (bar, child) => {\n bar.packStart(child);\n },\n (bar, child) => {\n bar.remove(child);\n },\n ),\n addRemoveSlot<Gtk.Widget, Gtk.HeaderBar | Gtk.ActionBar>(\n \"end\",\n \"GtkWidget\",\n (bar, child) => {\n bar.packEnd(child);\n },\n (bar, child) => {\n bar.remove(child);\n },\n ),\n ],\n }),\n GtkWindow: {\n behaviors: [childSetterSlot()],\n },\n GtkWidget: {\n behaviors: [\n slot<Gtk.Widget, Gtk.Popover>(\"children\", \"GtkPopover\", {\n attach: (parent, popover) => {\n popover.setParent(parent);\n },\n detach: (_parent, popover) => {\n popover.unparent();\n },\n }),\n addRemoveSlot<Gtk.EventController, Gtk.Widget>(\n \"controllers\",\n \"GtkEventController\",\n (widget, controller) => {\n widget.addController(controller);\n },\n (widget, controller) => {\n widget.removeController(controller);\n },\n ),\n slot<Gtk.Widget, Gtk.LayoutManager>(\"layoutManager\", \"GtkLayoutManager\", {\n attach: (widget, manager) => {\n widget.setLayoutManager(manager);\n },\n detach: (widget) => {\n widget.setLayoutManager(null);\n },\n }),\n slot<Gtk.Widget, Gio.ActionGroup>(\"actionGroups\", \"GActionGroup\", {\n attach: (widget, group, info) => {\n widget.insertActionGroup((info.props.prefix as string | null) ?? \"\", group);\n },\n detach: (widget, _group, info) => {\n widget.insertActionGroup((info.props.prefix as string | null) ?? \"\", null);\n },\n }),\n ],\n },\n GtkBox: {\n behaviors: [boxSlot<Gtk.Box>()],\n },\n GtkListBox: {\n behaviors: [\n wrappingIndexedSlot(Gtk.ListBoxRow, (row, inner) => {\n row.setChild(inner);\n }),\n ],\n },\n GtkFlowBox: {\n behaviors: [\n wrappingIndexedSlot(Gtk.FlowBoxChild, (child, inner) => {\n child.setChild(inner);\n }),\n ],\n },\n GtkOverlay: {\n behaviors: [\n childSetterSlot<Gtk.Overlay>(),\n slot<Gtk.Overlay, Gtk.Widget>(\"overlays\", \"GtkWidget\", {\n attach: (overlay, child) => {\n overlay.addOverlay(child);\n },\n detach: (overlay, child) => {\n overlay.removeOverlay(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkShortcutController: {\n behaviors: [\n addRemoveSlot<Gtk.Shortcut, Gtk.ShortcutController>(\n \"shortcuts\",\n \"GtkShortcut\",\n (controller, shortcut) => {\n controller.addShortcut(shortcut);\n },\n (controller, shortcut) => {\n controller.removeShortcut(shortcut);\n },\n ),\n ],\n },\n GtkTextChildAnchor: {\n behaviors: [{ create: () => Gtk.TextChildAnchor.new() }],\n },\n GtkTextView: {\n behaviors: [\n slot<Gtk.TextView, Gtk.TextBuffer>(\"children\", \"GtkTextBuffer\", {\n attach: (view, buffer) => {\n view.setBuffer(buffer);\n },\n detach: (view) => {\n view.setBuffer(null);\n },\n }),\n ],\n },\n GActionMap: {\n behaviors: [\n slot<Gio.ActionMap, Gio.Action>(\"actions\", \"GAction\", {\n attach: (map, action) => {\n map.addAction(action);\n },\n detach: (map, _action, info) => {\n map.removeAction((info.props.name as string | null) ?? \"\");\n },\n }),\n ],\n },\n GMenu: {\n behaviors: [\n list<Gio.Menu, MenuItem>(\"items\", {\n clear: (menu) => {\n menu.removeAll();\n },\n add: (menu, item) => {\n appendMenuItem(menu, item);\n },\n }),\n ],\n },\n GtkColumnView: {\n behaviors: [\n slot<Gtk.ColumnView, Gtk.ColumnViewColumn>(\"children\", \"GtkColumnViewColumn\", {\n attach: (view, column, info) => {\n view.insertColumn(info.index, column);\n },\n detach: (view, column) => {\n view.removeColumn(column);\n },\n }),\n ],\n },\n GtkGrid: {\n behaviors: [\n slot<Gtk.Grid, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (grid, child) => {\n grid.attach(child, 0, 0, 1, 1);\n },\n detach: (grid, child) => {\n grid.remove(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkFixed: {\n behaviors: [\n slot<Gtk.Fixed, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (fixed, child) => {\n fixed.put(child, 0, 0);\n },\n detach: (fixed, child) => {\n fixed.remove(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkSizeGroup: {\n behaviors: [\n list<Gtk.SizeGroup, Gtk.Widget>(\"widgets\", {\n add: (group, widget) => {\n group.addWidget(widget);\n },\n remove: (group, widget) => {\n group.removeWidget(widget);\n },\n }),\n ],\n },\n GtkConstraintLayout: {\n behaviors: [\n addRemoveSlot<Gtk.Constraint, Gtk.ConstraintLayout>(\n \"constraints\",\n \"GtkConstraint\",\n (layout, constraint) => {\n layout.addConstraint(constraint);\n },\n (layout, constraint) => {\n layout.removeConstraint(constraint);\n },\n ),\n addRemoveSlot<Gtk.ConstraintGuide, Gtk.ConstraintLayout>(\n \"guides\",\n \"GtkConstraintGuide\",\n (layout, guide) => {\n layout.addGuide(guide);\n },\n (layout, guide) => {\n layout.removeGuide(guide);\n },\n ),\n list<Gtk.ConstraintLayout, VflConstraints, Gtk.Constraint[]>(\"vfl\", {\n add: (layout, item) => [\n ...layout.addConstraintsFromDescription(\n item.lines,\n item.hspacing ?? 0,\n item.vspacing ?? 0,\n item.views ?? new Map<string, Gtk.ConstraintTarget>(),\n ),\n ],\n remove: (layout, _item, constraints) => {\n for (const constraint of constraints) {\n layout.removeConstraint(constraint);\n }\n },\n }),\n ],\n },\n GtkStack: {\n behaviors: [\n adoptedChildrenSlot<Gtk.Stack, Gtk.Widget>(\n \"GtkWidget\",\n (stack, child) => stack.addChild(child),\n (stack, child) => {\n stack.remove(child);\n },\n ),\n deferred<Gtk.Stack, string>(\"visibleChildName\", (stack, name) => stack.getChildByName(name) !== null),\n ],\n },\n GtkNotebook: {\n behaviors: [\n slot<Gtk.Notebook, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (notebook, child, info) => notebook.insertPage(child, null, info.index),\n reorder: (notebook, child, info) => {\n notebook.reorderChild(child, info.index);\n },\n detach: (notebook, child) => {\n notebook.detachTab(child);\n },\n resolve: (notebook, child) => notebook.getPage(child),\n }),\n ],\n },\n GtkApplication: {\n behaviors: [\n addRemoveSlot<Gtk.Window, Gtk.Application>(\n \"children\",\n \"GtkWindow\",\n (application, window) => {\n application.addWindow(window);\n },\n (application, window) => {\n application.removeWindow(window);\n },\n ),\n list<Gtk.Application, ActionAccel>(\"actionAccels\", {\n add: (application, item) => {\n application.setAccelsForAction(item.detailedActionName, item.accels);\n },\n remove: (application, item) => {\n application.setAccelsForAction(item.detailedActionName, []);\n },\n }),\n ],\n },\n GtkAboutDialog: {\n behaviors: [\n list<Gtk.AboutDialog, CreditSection>(\"creditSections\", {\n add: (dialog, section) => {\n dialog.addCreditSection(section.sectionName, section.people);\n },\n }),\n ],\n },\n GtkScale: {\n behaviors: [\n list<Gtk.Scale, ScaleMark>(\"marks\", {\n add: (scale, mark) => {\n scale.addMark(mark.value ?? 0, mark.position, mark.markup ?? null);\n },\n clear: (scale) => {\n scale.clearMarks();\n },\n }),\n ],\n },\n GtkCalendar: {\n behaviors: [\n list<Gtk.Calendar, number>(\"markedDays\", {\n add: (calendar, day) => {\n calendar.markDay(day);\n },\n clear: (calendar) => {\n calendar.clearMarks();\n },\n }),\n ],\n },\n GtkLevelBar: {\n behaviors: [\n list<Gtk.LevelBar, LevelBarOffset>(\"offsets\", {\n add: (bar, offset) => {\n bar.addOffsetValue(offset.name, offset.value ?? 0);\n },\n remove: (bar, offset) => {\n bar.removeOffsetValue(offset.name);\n },\n }),\n ],\n },\n GtkDropTarget: {\n behaviors: [\n value<Gtk.DropTarget, GObject.Type[]>(\"types\", (target, types) => {\n target.setGtypes(types);\n }),\n ],\n },\n GtkDrawingArea: {\n behaviors: [\n value<Gtk.DrawingArea, Gtk.DrawingAreaDrawFunc>(\"drawFunc\", (area, draw) => {\n area.setDrawFunc(draw);\n area.queueDraw();\n }),\n ],\n },\n GtkDragSource: {\n behaviors: [\n value<Gtk.DragSource, DragSourceIcon>(\"icon\", (source, icon) => {\n source.setIcon(icon.paintable ?? null, icon.hotX ?? 0, icon.hotY ?? 0);\n }),\n ],\n },\n GtkEditable: {\n behaviors: [controlledText(\"text\")],\n },\n};\n\nfunction layoutChild(parent: Gtk.Widget, child: Gtk.Widget): GObject.Object | null {\n return parent.getLayoutManager()?.getLayoutChild(child) ?? null;\n}\n\nconst buildMenu = (items: MenuItem[]): Gio.Menu => {\n const menu = Gio.Menu.new();\n\n for (const item of items) {\n appendMenuItem(menu, item);\n }\n\n return menu;\n};\n\nfunction appendMenuItem(menu: Gio.Menu, item: MenuItem): void {\n const label = item.label ?? null;\n\n if (item.submenu !== undefined) {\n menu.appendSubmenu(label, buildMenu(item.submenu));\n\n return;\n }\n\n if (item.section !== undefined) {\n menu.appendSection(label, buildMenu(item.section));\n\n return;\n }\n\n menu.append(label, item.action ?? null);\n}\n\nregisterElements(BUILTIN_ELEMENTS);\nregisterElements(BUILTIN_BEHAVIORS);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ElementConfig } from "./reconciler/registry.js";
|
|
2
|
+
declare const SINGLE_CHILD_TYPES: string[];
|
|
3
|
+
/**
|
|
4
|
+
* The static, runtime-free half of the built-in element configuration: which base props interface each
|
|
5
|
+
* generated element extends, which component wraps it, and whether its GObject is created lazily by its
|
|
6
|
+
* parent. Codegen imports this module, so it must never reach the GObject bindings.
|
|
7
|
+
*/
|
|
8
|
+
declare const BUILTIN_ELEMENTS: Record<string, ElementConfig>;
|
|
9
|
+
export { SINGLE_CHILD_TYPES, BUILTIN_ELEMENTS };
|
|
10
|
+
//# sourceMappingURL=element-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-config.d.ts","sourceRoot":"","sources":["../src/element-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,0BAA0B,CAAC;AAElF,QAAA,MAAM,kBAAkB,EAAE,MAAM,EAsB/B,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAkHnD,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { forTypes, internal } from "./reconciler/registry.js";
|
|
2
|
+
const SINGLE_CHILD_TYPES = [
|
|
3
|
+
"GtkAspectFrame",
|
|
4
|
+
"GtkButton",
|
|
5
|
+
"GtkCheckButton",
|
|
6
|
+
"GtkComboBox",
|
|
7
|
+
"GtkDragIcon",
|
|
8
|
+
"GtkExpander",
|
|
9
|
+
"GtkFlowBoxChild",
|
|
10
|
+
"GtkFrame",
|
|
11
|
+
"GtkGraphicsOffload",
|
|
12
|
+
"GtkListBoxRow",
|
|
13
|
+
"GtkListHeader",
|
|
14
|
+
"GtkListItem",
|
|
15
|
+
"GtkMenuButton",
|
|
16
|
+
"GtkPopover",
|
|
17
|
+
"GtkPopoverBin",
|
|
18
|
+
"GtkRevealer",
|
|
19
|
+
"GtkScrolledWindow",
|
|
20
|
+
"GtkSearchBar",
|
|
21
|
+
"GtkTreeExpander",
|
|
22
|
+
"GtkViewport",
|
|
23
|
+
"GtkWindowHandle",
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* The static, runtime-free half of the built-in element configuration: which base props interface each
|
|
27
|
+
* generated element extends, which component wraps it, and whether its GObject is created lazily by its
|
|
28
|
+
* parent. Codegen imports this module, so it must never reach the GObject bindings.
|
|
29
|
+
*/
|
|
30
|
+
const BUILTIN_ELEMENTS = {
|
|
31
|
+
...forTypes(SINGLE_CHILD_TYPES, {
|
|
32
|
+
props: internal("ChildrenProps"),
|
|
33
|
+
}),
|
|
34
|
+
...forTypes(["GtkHeaderBar", "GtkActionBar"], {
|
|
35
|
+
props: internal("GtkHeaderBarProps"),
|
|
36
|
+
}),
|
|
37
|
+
GtkWindow: {
|
|
38
|
+
props: internal("ChildrenProps"),
|
|
39
|
+
component: internal("createWindowComponent"),
|
|
40
|
+
},
|
|
41
|
+
GtkLabel: {
|
|
42
|
+
props: internal("ChildrenProps"),
|
|
43
|
+
},
|
|
44
|
+
GtkTextBuffer: {
|
|
45
|
+
props: internal("ChildrenProps"),
|
|
46
|
+
},
|
|
47
|
+
GtkTextTag: {
|
|
48
|
+
props: internal("ChildrenProps"),
|
|
49
|
+
},
|
|
50
|
+
GtkTextChildAnchor: {
|
|
51
|
+
props: internal("GtkTextChildAnchorProps"),
|
|
52
|
+
},
|
|
53
|
+
GtkGridLayoutChild: {
|
|
54
|
+
lazy: true,
|
|
55
|
+
},
|
|
56
|
+
GtkFixedLayoutChild: {
|
|
57
|
+
lazy: true,
|
|
58
|
+
},
|
|
59
|
+
GtkOverlayLayoutChild: {
|
|
60
|
+
lazy: true,
|
|
61
|
+
},
|
|
62
|
+
GtkStackPage: {
|
|
63
|
+
lazy: true,
|
|
64
|
+
},
|
|
65
|
+
GtkNotebookPage: {
|
|
66
|
+
lazy: true,
|
|
67
|
+
},
|
|
68
|
+
GActionGroup: {
|
|
69
|
+
props: internal("GActionGroupProps"),
|
|
70
|
+
},
|
|
71
|
+
GtkWidget: {
|
|
72
|
+
props: internal("GtkWidgetProps"),
|
|
73
|
+
},
|
|
74
|
+
GtkBox: {
|
|
75
|
+
props: internal("ChildrenProps"),
|
|
76
|
+
},
|
|
77
|
+
GtkListBox: {
|
|
78
|
+
props: internal("ChildrenProps"),
|
|
79
|
+
},
|
|
80
|
+
GtkFlowBox: {
|
|
81
|
+
props: internal("ChildrenProps"),
|
|
82
|
+
},
|
|
83
|
+
GtkOverlay: {
|
|
84
|
+
props: internal("GtkOverlayProps"),
|
|
85
|
+
},
|
|
86
|
+
GtkShortcutController: {
|
|
87
|
+
props: internal("GtkShortcutControllerProps"),
|
|
88
|
+
},
|
|
89
|
+
GtkTextView: {
|
|
90
|
+
props: internal("ChildrenProps"),
|
|
91
|
+
},
|
|
92
|
+
GActionMap: {
|
|
93
|
+
props: internal("GActionMapProps"),
|
|
94
|
+
},
|
|
95
|
+
GMenu: {
|
|
96
|
+
props: internal("GMenuProps"),
|
|
97
|
+
},
|
|
98
|
+
GtkColumnView: {
|
|
99
|
+
props: internal("ChildrenProps"),
|
|
100
|
+
},
|
|
101
|
+
GtkGrid: {
|
|
102
|
+
props: internal("ChildrenProps"),
|
|
103
|
+
},
|
|
104
|
+
GtkFixed: {
|
|
105
|
+
props: internal("ChildrenProps"),
|
|
106
|
+
},
|
|
107
|
+
GtkSizeGroup: {
|
|
108
|
+
props: internal("GtkSizeGroupProps"),
|
|
109
|
+
},
|
|
110
|
+
GtkConstraintLayout: {
|
|
111
|
+
props: internal("GtkConstraintLayoutProps"),
|
|
112
|
+
},
|
|
113
|
+
GtkStack: {
|
|
114
|
+
props: internal("ChildrenProps"),
|
|
115
|
+
},
|
|
116
|
+
GtkNotebook: {
|
|
117
|
+
props: internal("ChildrenProps"),
|
|
118
|
+
},
|
|
119
|
+
GtkApplication: {
|
|
120
|
+
props: internal("GtkApplicationProps"),
|
|
121
|
+
component: internal("createApplicationComponent"),
|
|
122
|
+
},
|
|
123
|
+
GtkAboutDialog: {
|
|
124
|
+
props: internal("GtkAboutDialogProps"),
|
|
125
|
+
},
|
|
126
|
+
GtkScale: {
|
|
127
|
+
props: internal("GtkScaleProps"),
|
|
128
|
+
},
|
|
129
|
+
GtkCalendar: {
|
|
130
|
+
props: internal("GtkCalendarProps"),
|
|
131
|
+
},
|
|
132
|
+
GtkLevelBar: {
|
|
133
|
+
props: internal("GtkLevelBarProps"),
|
|
134
|
+
},
|
|
135
|
+
GtkDropTarget: {
|
|
136
|
+
props: internal("GtkDropTargetProps"),
|
|
137
|
+
},
|
|
138
|
+
GtkDrawingArea: {
|
|
139
|
+
props: internal("GtkDrawingAreaProps"),
|
|
140
|
+
},
|
|
141
|
+
GtkDragSource: {
|
|
142
|
+
props: internal("GtkDragSourceProps"),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
export { SINGLE_CHILD_TYPES, BUILTIN_ELEMENTS };
|
|
146
|
+
//# sourceMappingURL=element-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-config.js","sourceRoot":"","sources":["../src/element-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAElF,MAAM,kBAAkB,GAAa;IACjC,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,UAAU;IACV,oBAAoB;IACpB,eAAe;IACf,eAAe;IACf,aAAa;IACb,eAAe;IACf,YAAY;IACZ,eAAe;IACf,aAAa;IACb,mBAAmB;IACnB,cAAc;IACd,iBAAiB;IACjB,aAAa;IACb,iBAAiB;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAkC;IACpD,GAAG,QAAQ,CAAC,kBAAkB,EAAE;QAC5B,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;KACnC,CAAC;IACF,GAAG,QAAQ,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE;QAC1C,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC;KACvC,CAAC;IACF,SAAS,EAAE;QACP,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;QAChC,SAAS,EAAE,QAAQ,CAAC,uBA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,eAAe,CAAC;KACnC;IACD,OAAO,EAAE;QACL,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;KACnC;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;KACnC;IACD,YAAY,EAAE;QACV,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC;KACvC;IACD,mBAAmB,EAAE;QACjB,KAAK,EAAE,QAAQ,CAAC,0BAA0B,CAAC;KAC9C;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;KACnC;IACD,WAAW,EAAE;QACT,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;KACnC;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC;QACtC,SAAS,EAAE,QAAQ,CAAC,4BAA4B,CAAC;KACpD;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC;KACzC;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC;KACnC;IACD,WAAW,EAAE;QACT,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC;KACtC;IACD,WAAW,EAAE;QACT,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC;KACtC;IACD,aAAa,EAAE;QACX,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC;KACxC;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC;KACzC;IACD,aAAa,EAAE;QACX,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC;KACxC;CACJ,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { type ElementConfig, forTypes, internal } from \"./reconciler/registry.js\";\n\nconst SINGLE_CHILD_TYPES: string[] = [\n \"GtkAspectFrame\",\n \"GtkButton\",\n \"GtkCheckButton\",\n \"GtkComboBox\",\n \"GtkDragIcon\",\n \"GtkExpander\",\n \"GtkFlowBoxChild\",\n \"GtkFrame\",\n \"GtkGraphicsOffload\",\n \"GtkListBoxRow\",\n \"GtkListHeader\",\n \"GtkListItem\",\n \"GtkMenuButton\",\n \"GtkPopover\",\n \"GtkPopoverBin\",\n \"GtkRevealer\",\n \"GtkScrolledWindow\",\n \"GtkSearchBar\",\n \"GtkTreeExpander\",\n \"GtkViewport\",\n \"GtkWindowHandle\",\n];\n\n/**\n * The static, runtime-free half of the built-in element configuration: which base props interface each\n * generated element extends, which component wraps it, and whether its GObject is created lazily by its\n * parent. Codegen imports this module, so it must never reach the GObject bindings.\n */\nconst BUILTIN_ELEMENTS: Record<string, ElementConfig> = {\n ...forTypes(SINGLE_CHILD_TYPES, {\n props: internal(\"ChildrenProps\"),\n }),\n ...forTypes([\"GtkHeaderBar\", \"GtkActionBar\"], {\n props: internal(\"GtkHeaderBarProps\"),\n }),\n GtkWindow: {\n props: internal(\"ChildrenProps\"),\n component: internal(\"createWindowComponent\"),\n },\n GtkLabel: {\n props: internal(\"ChildrenProps\"),\n },\n GtkTextBuffer: {\n props: internal(\"ChildrenProps\"),\n },\n GtkTextTag: {\n props: internal(\"ChildrenProps\"),\n },\n GtkTextChildAnchor: {\n props: internal(\"GtkTextChildAnchorProps\"),\n },\n GtkGridLayoutChild: {\n lazy: true,\n },\n GtkFixedLayoutChild: {\n lazy: true,\n },\n GtkOverlayLayoutChild: {\n lazy: true,\n },\n GtkStackPage: {\n lazy: true,\n },\n GtkNotebookPage: {\n lazy: true,\n },\n GActionGroup: {\n props: internal(\"GActionGroupProps\"),\n },\n GtkWidget: {\n props: internal(\"GtkWidgetProps\"),\n },\n GtkBox: {\n props: internal(\"ChildrenProps\"),\n },\n GtkListBox: {\n props: internal(\"ChildrenProps\"),\n },\n GtkFlowBox: {\n props: internal(\"ChildrenProps\"),\n },\n GtkOverlay: {\n props: internal(\"GtkOverlayProps\"),\n },\n GtkShortcutController: {\n props: internal(\"GtkShortcutControllerProps\"),\n },\n GtkTextView: {\n props: internal(\"ChildrenProps\"),\n },\n GActionMap: {\n props: internal(\"GActionMapProps\"),\n },\n GMenu: {\n props: internal(\"GMenuProps\"),\n },\n GtkColumnView: {\n props: internal(\"ChildrenProps\"),\n },\n GtkGrid: {\n props: internal(\"ChildrenProps\"),\n },\n GtkFixed: {\n props: internal(\"ChildrenProps\"),\n },\n GtkSizeGroup: {\n props: internal(\"GtkSizeGroupProps\"),\n },\n GtkConstraintLayout: {\n props: internal(\"GtkConstraintLayoutProps\"),\n },\n GtkStack: {\n props: internal(\"ChildrenProps\"),\n },\n GtkNotebook: {\n props: internal(\"ChildrenProps\"),\n },\n GtkApplication: {\n props: internal(\"GtkApplicationProps\"),\n component: internal(\"createApplicationComponent\"),\n },\n GtkAboutDialog: {\n props: internal(\"GtkAboutDialogProps\"),\n },\n GtkScale: {\n props: internal(\"GtkScaleProps\"),\n },\n GtkCalendar: {\n props: internal(\"GtkCalendarProps\"),\n },\n GtkLevelBar: {\n props: internal(\"GtkLevelBarProps\"),\n },\n GtkDropTarget: {\n props: internal(\"GtkDropTargetProps\"),\n },\n GtkDrawingArea: {\n props: internal(\"GtkDrawingAreaProps\"),\n },\n GtkDragSource: {\n props: internal(\"GtkDragSourceProps\"),\n },\n};\n\nexport { SINGLE_CHILD_TYPES, BUILTIN_ELEMENTS };\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type * as Gtk from "@gtkx/gi/gtk";
|
|
2
2
|
import { type Context } from "react";
|
|
3
|
-
|
|
3
|
+
declare const ApplicationContext: Context<Gtk.Application | null>;
|
|
4
4
|
/**
|
|
5
|
-
* Returns the `Gtk.Application` provided by the nearest `
|
|
5
|
+
* Returns the `Gtk.Application` provided by the nearest `GtkApplication` ancestor, throwing if used outside one.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
declare const useApplication: () => Gtk.Application;
|
|
8
|
+
export { ApplicationContext, useApplication };
|
|
8
9
|
//# sourceMappingURL=use-application.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-application.d.ts","sourceRoot":"","sources":["../../src/hooks/use-application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,OAAO,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"use-application.d.ts","sourceRoot":"","sources":["../../src/hooks/use-application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,OAAO,CAAC;AAEzD,QAAA,MAAM,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAA+C,CAAC;AAExG;;GAEG;AACH,QAAA,MAAM,cAAc,QAAO,GAAG,CAAC,WAQ9B,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createContext, use } from "react";
|
|
2
|
-
|
|
2
|
+
const ApplicationContext = createContext(null);
|
|
3
3
|
/**
|
|
4
|
-
* Returns the `Gtk.Application` provided by the nearest `
|
|
4
|
+
* Returns the `Gtk.Application` provided by the nearest `GtkApplication` ancestor, throwing if used outside one.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
const useApplication = () => {
|
|
7
7
|
const context = use(ApplicationContext);
|
|
8
8
|
if (!context) {
|
|
9
|
-
throw new Error("
|
|
9
|
+
throw new Error("useApplication must be called within GtkApplication");
|
|
10
10
|
}
|
|
11
11
|
return context;
|
|
12
12
|
};
|
|
13
|
+
export { ApplicationContext, useApplication };
|
|
13
14
|
//# sourceMappingURL=use-application.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-application.js","sourceRoot":"","sources":["../../src/hooks/use-application.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,
|
|
1
|
+
{"version":3,"file":"use-application.js","sourceRoot":"","sources":["../../src/hooks/use-application.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,kBAAkB,GAAoC,aAAa,CAAyB,IAAI,CAAC,CAAC;AAExG;;GAEG;AACH,MAAM,cAAc,GAAG,GAAoB,EAAE;IACzC,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAExC,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport { type Context, createContext, use } from \"react\";\n\nconst ApplicationContext: Context<Gtk.Application | null> = createContext<Gtk.Application | null>(null);\n\n/**\n * Returns the `Gtk.Application` provided by the nearest `GtkApplication` ancestor, throwing if used outside one.\n */\nconst useApplication = (): Gtk.Application => {\n const context = use(ApplicationContext);\n\n if (!context) {\n throw new Error(\"useApplication must be called within GtkApplication\");\n }\n\n return context;\n};\n\nexport { ApplicationContext, useApplication };\n"]}
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import * as Gio from "@gtkx/gi/gio";
|
|
2
1
|
import type * as GObject from "@gtkx/gi/gobject";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import * as Gio from "@gtkx/gi/gio";
|
|
3
|
+
import type { SettingsSchema, SettingsSchemaKeys } from "../utils/settings.js";
|
|
4
|
+
import { type RefProp } from "../utils/ref-prop.js";
|
|
5
|
+
type UseBindSettingOptions<K extends SettingsSchemaKeys> = {
|
|
6
|
+
schema: SettingsSchema<K>;
|
|
7
|
+
key: keyof K & string;
|
|
8
|
+
object: RefProp<GObject.Object>;
|
|
9
|
+
property: string;
|
|
10
|
+
flags?: Gio.SettingsBindFlags;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Binds a GSettings key to a property of a GObject, keeping the two in sync for the object's lifetime.
|
|
14
|
+
*
|
|
15
|
+
* @param options.schema The schema reference identifying the settings backend.
|
|
16
|
+
* @param options.key The key within the schema to bind.
|
|
17
|
+
* @param options.object The GObject whose property is bound to the setting.
|
|
18
|
+
* @param options.property The name of the object property to bind.
|
|
19
|
+
* @param options.flags Flags controlling the binding's direction and behaviour.
|
|
20
|
+
*/
|
|
21
|
+
declare function useBindSetting<K extends SettingsSchemaKeys>({ schema, key, object, property, flags, }: UseBindSettingOptions<K>): void;
|
|
22
|
+
export { useBindSetting };
|
|
6
23
|
//# sourceMappingURL=use-bind-setting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bind-setting.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bind-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"use-bind-setting.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bind-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAGpC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,sBAAsB,CAAC;AAGpE,KAAK,qBAAqB,CAAC,CAAC,SAAS,kBAAkB,IAAI;IACvD,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC;CACjC,CAAC;AAEF;;;;;;;;GAQG;AACH,iBAAS,cAAc,CAAC,CAAC,SAAS,kBAAkB,EAAE,EAClD,MAAM,EACN,GAAG,EACH,MAAM,EACN,QAAQ,EACR,KAAqC,GACxC,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI,CAiBjC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import * as Gio from "@gtkx/gi/gio";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import { kebabCase } from "@gtkx/utils";
|
|
3
|
+
import { useLayoutEffect } from "react";
|
|
4
|
+
import { resolveRefProp } from "../utils/ref-prop.js";
|
|
5
|
+
import { useSettings } from "./use-setting.js";
|
|
6
|
+
/**
|
|
7
|
+
* Binds a GSettings key to a property of a GObject, keeping the two in sync for the object's lifetime.
|
|
8
|
+
*
|
|
9
|
+
* @param options.schema The schema reference identifying the settings backend.
|
|
10
|
+
* @param options.key The key within the schema to bind.
|
|
11
|
+
* @param options.object The GObject whose property is bound to the setting.
|
|
12
|
+
* @param options.property The name of the object property to bind.
|
|
13
|
+
* @param options.flags Flags controlling the binding's direction and behaviour.
|
|
14
|
+
*/
|
|
15
|
+
function useBindSetting({ schema, key, object, property, flags = Gio.SettingsBindFlags.DEFAULT, }) {
|
|
16
|
+
const settings = useSettings(schema);
|
|
17
|
+
const propertyName = kebabCase(property);
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
const resolved = resolveRefProp(object);
|
|
20
|
+
if (!resolved) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
settings.bind(key, resolved, propertyName, flags);
|
|
24
|
+
return () => {
|
|
25
|
+
Gio.Settings.unbind(resolved, propertyName);
|
|
26
|
+
};
|
|
27
|
+
}, [settings, key, object, propertyName, flags]);
|
|
18
28
|
}
|
|
29
|
+
export { useBindSetting };
|
|
19
30
|
//# sourceMappingURL=use-bind-setting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bind-setting.js","sourceRoot":"","sources":["../../src/hooks/use-bind-setting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-bind-setting.js","sourceRoot":"","sources":["../../src/hooks/use-bind-setting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C;;;;;;;;GAQG;AACH,SAAS,cAAc,CAA+B,EAClD,MAAM,EACN,GAAG,EACH,MAAM,EACN,QAAQ,EACR,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC,OAAO,GACd;IACvB,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEzC,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,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QAElD,OAAO,GAAG,EAAE;YACR,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChD,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gio from \"@gtkx/gi/gio\";\nimport { kebabCase } from \"@gtkx/utils\";\nimport { useLayoutEffect } from \"react\";\nimport type { SettingsSchema, SettingsSchemaKeys } from \"../utils/settings.js\";\nimport { type RefProp, resolveRefProp } from \"../utils/ref-prop.js\";\nimport { useSettings } from \"./use-setting.js\";\n\ntype UseBindSettingOptions<K extends SettingsSchemaKeys> = {\n schema: SettingsSchema<K>;\n key: keyof K & string;\n object: RefProp<GObject.Object>;\n property: string;\n flags?: Gio.SettingsBindFlags;\n};\n\n/**\n * Binds a GSettings key to a property of a GObject, keeping the two in sync for the object's lifetime.\n *\n * @param options.schema The schema reference identifying the settings backend.\n * @param options.key The key within the schema to bind.\n * @param options.object The GObject whose property is bound to the setting.\n * @param options.property The name of the object property to bind.\n * @param options.flags Flags controlling the binding's direction and behaviour.\n */\nfunction useBindSetting<K extends SettingsSchemaKeys>({\n schema,\n key,\n object,\n property,\n flags = Gio.SettingsBindFlags.DEFAULT,\n}: UseBindSettingOptions<K>): void {\n const settings = useSettings(schema);\n const propertyName = kebabCase(property);\n\n useLayoutEffect(() => {\n const resolved = resolveRefProp(object);\n\n if (!resolved) {\n return;\n }\n\n settings.bind(key, resolved, propertyName, flags);\n\n return () => {\n Gio.Settings.unbind(resolved, propertyName);\n };\n }, [settings, key, object, propertyName, flags]);\n}\n\nexport { useBindSetting };\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Ref, type RefCallback } from "react";
|
|
2
|
+
type PossibleRef<T> = Ref<T> | undefined;
|
|
3
|
+
type RefCleanup<T> = ReturnType<RefCallback<T>>;
|
|
4
|
+
declare function assignRef<T>(ref: PossibleRef<T>, value: T): RefCleanup<T>;
|
|
5
|
+
declare function mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T>;
|
|
6
|
+
declare function useMergedRef<T>(first: PossibleRef<T>, second: PossibleRef<T>): RefCallback<T>;
|
|
7
|
+
export { assignRef, mergeRefs, useMergedRef };
|
|
8
|
+
//# sourceMappingURL=use-merged-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-merged-refs.d.ts","sourceRoot":"","sources":["../../src/hooks/use-merged-refs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,WAAW,EAAW,MAAM,OAAO,CAAC;AAE5D,KAAK,WAAW,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AACzC,KAAK,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAGhD,iBAAS,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAQlE;AAsCD,iBAAS,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAI/D;AAED,iBAAS,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAEtF;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isRecord } from "@gtkx/utils";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
function assignRef(ref, value) {
|
|
4
|
+
if (typeof ref === "function") {
|
|
5
|
+
return ref(value);
|
|
6
|
+
}
|
|
7
|
+
if (isRecord(ref) && "current" in ref) {
|
|
8
|
+
ref.current = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function collectCleanup(cleanupMap, ref, node) {
|
|
12
|
+
const cleanup = assignRef(ref, node);
|
|
13
|
+
if (cleanup) {
|
|
14
|
+
cleanupMap.set(ref, cleanup);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function cleanupRef(cleanupMap, ref) {
|
|
18
|
+
const cleanup = cleanupMap.get(ref);
|
|
19
|
+
if (cleanup && typeof cleanup === "function") {
|
|
20
|
+
cleanup();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
assignRef(ref, null);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function applyRefs(cleanupMap, refs, node) {
|
|
27
|
+
for (const ref of refs) {
|
|
28
|
+
collectCleanup(cleanupMap, ref, node);
|
|
29
|
+
}
|
|
30
|
+
if (cleanupMap.size === 0) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return () => {
|
|
34
|
+
for (const ref of refs) {
|
|
35
|
+
cleanupRef(cleanupMap, ref);
|
|
36
|
+
}
|
|
37
|
+
cleanupMap.clear();
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function mergeRefs(...refs) {
|
|
41
|
+
const cleanupMap = new Map();
|
|
42
|
+
return (node) => applyRefs(cleanupMap, refs, node);
|
|
43
|
+
}
|
|
44
|
+
function useMergedRef(first, second) {
|
|
45
|
+
return useMemo(() => mergeRefs(first, second), [first, second]);
|
|
46
|
+
}
|
|
47
|
+
export { assignRef, mergeRefs, useMergedRef };
|
|
48
|
+
//# sourceMappingURL=use-merged-refs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-merged-refs.js","sourceRoot":"","sources":["../../src/hooks/use-merged-refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;A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ChC,CAAC;QAED,UAAU,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC,CAAC;AACN,CAAC;AAED,SAAS,SAAS,CAAI,GAAG,IAAsB;IAC3C,MAAM,UAAU,GAAkB,IAAI,GAAG,EAAE,CAAC;IAE5C,OAAO,CAAC,IAAc,EAAiB,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,YAAY,CAAI,KAAqB,EAAE,MAAsB;IAClE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { isRecord } from \"@gtkx/utils\";\nimport { type Ref, type RefCallback, useMemo } from \"react\";\n\ntype PossibleRef<T> = Ref<T> | undefined;\ntype RefCleanup<T> = ReturnType<RefCallback<T>>;\ntype CleanupMap<T> = Map<PossibleRef<T>, Exclude<RefCleanup<T>, void>>;\n\nfunction assignRef<T>(ref: PossibleRef<T>, value: T): RefCleanup<T> {\n if (typeof ref === \"function\") {\n return ref(value);\n }\n\n if (isRecord(ref) && \"current\" in ref) {\n ref.current = value;\n }\n}\n\nfunction collectCleanup<T>(cleanupMap: CleanupMap<T>, ref: PossibleRef<T>, node: T | null): void {\n const cleanup = assignRef(ref, node);\n\n if (cleanup) {\n cleanupMap.set(ref, cleanup);\n }\n}\n\nfunction cleanupRef<T>(cleanupMap: CleanupMap<T>, ref: PossibleRef<T>): void {\n const cleanup = cleanupMap.get(ref);\n\n if (cleanup && typeof cleanup === \"function\") {\n cleanup();\n } else {\n assignRef(ref, null);\n }\n}\n\nfunction applyRefs<T>(cleanupMap: CleanupMap<T>, refs: PossibleRef<T>[], node: T | null): RefCleanup<T> {\n for (const ref of refs) {\n collectCleanup(cleanupMap, ref, node);\n }\n\n if (cleanupMap.size === 0) {\n return;\n }\n\n return () => {\n for (const ref of refs) {\n cleanupRef(cleanupMap, ref);\n }\n\n cleanupMap.clear();\n };\n}\n\nfunction mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T> {\n const cleanupMap: CleanupMap<T> = new Map();\n\n return (node: T | null): RefCleanup<T> => applyRefs(cleanupMap, refs, node);\n}\n\nfunction useMergedRef<T>(first: PossibleRef<T>, second: PossibleRef<T>): RefCallback<T> {\n return useMemo(() => mergeRefs(first, second), [first, second]);\n}\n\nexport { assignRef, mergeRefs, useMergedRef };\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as GObject from "@gtkx/gi/gobject";
|
|
2
|
-
import { type
|
|
3
|
-
|
|
2
|
+
import { type RefProp } from "../utils/ref-prop.js";
|
|
3
|
+
declare function useObjectValue<T extends GObject.Object, V>(object: RefProp<T>, signal: string, read: (object: T | null) => V): V;
|
|
4
|
+
export { useObjectValue };
|
|
4
5
|
//# sourceMappingURL=use-object-value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-object-value.d.ts","sourceRoot":"","sources":["../../src/hooks/use-object-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"use-object-value.d.ts","sourceRoot":"","sources":["../../src/hooks/use-object-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,sBAAsB,CAAC;AAQpE,iBAAS,cAAc,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,EAC/C,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,GAC9B,CAAC,CAoCH;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import { useCallback, useRef, useSyncExternalStore } from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const resolved =
|
|
5
|
-
const readRef = useRef(read);
|
|
6
|
-
readRef.current = read;
|
|
2
|
+
import { resolveRefProp } from "../utils/ref-prop.js";
|
|
3
|
+
function useObjectValue(object, signal, read) {
|
|
4
|
+
const resolved = resolveRefProp(object);
|
|
7
5
|
const cacheRef = useRef(null);
|
|
8
|
-
const readNow = useCallback(() => {
|
|
9
|
-
const cache = { object: resolved, signal, value: readRef.current(resolved) };
|
|
10
|
-
cacheRef.current = cache;
|
|
11
|
-
return cache;
|
|
12
|
-
}, [resolved, signal]);
|
|
13
|
-
const getSnapshot = useCallback(() => {
|
|
14
|
-
const cache = cacheRef.current;
|
|
15
|
-
if (cache !== null && cache.object === resolved && cache.signal === signal) {
|
|
16
|
-
return cache.value;
|
|
17
|
-
}
|
|
18
|
-
return readNow().value;
|
|
19
|
-
}, [resolved, signal, readNow]);
|
|
20
6
|
const subscribe = useCallback((onStoreChange) => {
|
|
21
|
-
if (resolved === null)
|
|
22
|
-
return () =>
|
|
7
|
+
if (resolved === null) {
|
|
8
|
+
return () => undefined;
|
|
9
|
+
}
|
|
23
10
|
const handler = () => {
|
|
24
|
-
|
|
11
|
+
cacheRef.current = null;
|
|
25
12
|
onStoreChange();
|
|
26
13
|
};
|
|
27
14
|
resolved.on(signal, handler);
|
|
28
15
|
return () => resolved.off(signal, handler);
|
|
29
|
-
}, [resolved, signal
|
|
16
|
+
}, [resolved, signal]);
|
|
17
|
+
const getSnapshot = () => {
|
|
18
|
+
const cache = cacheRef.current;
|
|
19
|
+
if (cache !== null && cache.object === resolved && cache.signal === signal) {
|
|
20
|
+
return cache.value;
|
|
21
|
+
}
|
|
22
|
+
const value = read(resolved);
|
|
23
|
+
cacheRef.current = { object: resolved, signal, value };
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
30
26
|
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
31
27
|
}
|
|
28
|
+
export { useObjectValue };
|
|
32
29
|
//# sourceMappingURL=use-object-value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-object-value.js","sourceRoot":"","sources":["../../src/hooks/use-object-value.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"use-object-value.js","sourceRoot":"","sources":["../../src/hooks/use-object-value.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQpE,SAAS,cAAc,CACnB,MAAkB,EAClB,MAAc,EACd,IAA6B;IAE7B,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,CAAgC,IAAI,CAAC,CAAC;IAE7D,MAAM,SAAS,GAAG,WAAW,CACzB,CAAC,aAAyB,EAAgB,EAAE;QACxC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACpB,OAAO,GAAS,EAAE,CAAC,SAAS,CAAC;QACjC,CAAC;QAED,MAAM,OAAO,GAAkB,GAAG,EAAE;YAChC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YACxB,aAAa,EAAE,CAAC;QACpB,CAAC,CAAC;QAEF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE7B,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,EACD,CAAC,QAAQ,EAAE,MAAM,CAAC,CACrB,CAAC;IAEF,MAAM,WAAW,GAAG,GAAM,EAAE;QACxB,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC;QAE/B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC,KAAK,CAAC;QACvB,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,QAAQ,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAEvD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACrE,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { SignalHandler } from \"@gtkx/runtime\";\nimport { useCallback, useRef, useSyncExternalStore } from \"react\";\nimport { type RefProp, resolveRefProp } from \"../utils/ref-prop.js\";\n\ntype ObjectValueCache<T extends GObject.Object, V> = {\n object: T | null;\n signal: string;\n value: V;\n};\n\nfunction useObjectValue<T extends GObject.Object, V>(\n object: RefProp<T>,\n signal: string,\n read: (object: T | null) => V,\n): V {\n const resolved = resolveRefProp(object);\n const cacheRef = useRef<ObjectValueCache<T, V> | null>(null);\n\n const subscribe = useCallback(\n (onStoreChange: () => void): (() => void) => {\n if (resolved === null) {\n return (): void => undefined;\n }\n\n const handler: SignalHandler = () => {\n cacheRef.current = null;\n onStoreChange();\n };\n\n resolved.on(signal, handler);\n\n return () => resolved.off(signal, handler);\n },\n [resolved, signal],\n );\n\n const getSnapshot = (): V => {\n const cache = cacheRef.current;\n\n if (cache !== null && cache.object === resolved && cache.signal === signal) {\n return cache.value;\n }\n\n const value = read(resolved);\n cacheRef.current = { object: resolved, signal, value };\n\n return value;\n };\n\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n}\n\nexport { useObjectValue };\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type * as Gtk from "@gtkx/gi/gtk";
|
|
2
2
|
import { type Context } from "react";
|
|
3
|
-
|
|
3
|
+
declare const ParentWindowContext: Context<Gtk.Window | null>;
|
|
4
4
|
/**
|
|
5
5
|
* Returns the `Gtk.Window` provided by the nearest window ancestor, or `null` when there is none.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
declare const useParentWindow: () => Gtk.Window | null;
|
|
8
|
+
export { ParentWindowContext, useParentWindow };
|
|
8
9
|
//# sourceMappingURL=use-parent-window.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-parent-window.d.ts","sourceRoot":"","sources":["../../src/hooks/use-parent-window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,OAAO,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"use-parent-window.d.ts","sourceRoot":"","sources":["../../src/hooks/use-parent-window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,OAAO,CAAC;AAEzD,QAAA,MAAM,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAA0C,CAAC;AAE/F;;GAEG;AACH,QAAA,MAAM,eAAe,QAAO,GAAG,CAAC,MAAM,GAAG,IAAgC,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createContext, use } from "react";
|
|
2
|
-
|
|
2
|
+
const ParentWindowContext = createContext(null);
|
|
3
3
|
/**
|
|
4
4
|
* Returns the `Gtk.Window` provided by the nearest window ancestor, or `null` when there is none.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
const useParentWindow = () => use(ParentWindowContext);
|
|
7
|
+
export { ParentWindowContext, useParentWindow };
|
|
7
8
|
//# sourceMappingURL=use-parent-window.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-parent-window.js","sourceRoot":"","sources":["../../src/hooks/use-parent-window.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,
|
|
1
|
+
{"version":3,"file":"use-parent-window.js","sourceRoot":"","sources":["../../src/hooks/use-parent-window.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,mBAAmB,GAA+B,aAAa,CAAoB,IAAI,CAAC,CAAC;AAE/F;;GAEG;AACH,MAAM,eAAe,GAAG,GAAsB,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport { type Context, createContext, use } from \"react\";\n\nconst ParentWindowContext: Context<Gtk.Window | null> = createContext<Gtk.Window | null>(null);\n\n/**\n * Returns the `Gtk.Window` provided by the nearest window ancestor, or `null` when there is none.\n */\nconst useParentWindow = (): Gtk.Window | null => use(ParentWindowContext);\n\nexport { ParentWindowContext, useParentWindow };\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as GObject from "@gtkx/gi/gobject";
|
|
2
|
-
import type {
|
|
3
|
-
type
|
|
4
|
-
|
|
2
|
+
import type { RefProp } from "../utils/ref-prop.js";
|
|
3
|
+
type Properties<T extends GObject.Object> = NonNullable<T["__properties__"]>;
|
|
4
|
+
type PropertyName<T extends GObject.Object> = keyof Properties<T> & keyof T;
|
|
5
5
|
/**
|
|
6
6
|
* Subscribes to a GObject property and returns its current value, re-rendering when the property changes.
|
|
7
7
|
*
|
|
@@ -9,6 +9,6 @@ export type PropertyNameOf<T extends GObject.Object> = keyof PropertiesOf<T> & k
|
|
|
9
9
|
* @param propertyName The camelCase name of a readable property on the object.
|
|
10
10
|
* @returns The current property value, or `undefined` when the object is not resolved.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
export {};
|
|
12
|
+
declare function useProperty<T extends GObject.Object, P extends PropertyName<T>>(object: RefProp<T>, propertyName: P & string): T[P] | undefined;
|
|
13
|
+
export { useProperty, type PropertyName };
|
|
14
14
|
//# sourceMappingURL=use-property.d.ts.map
|