@gtkx/react 1.0.0-rc.2 → 1.0.0-rc.3

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.
Files changed (67) hide show
  1. package/dist/adw/element-behaviors.js +6 -36
  2. package/dist/adw/element-behaviors.js.map +1 -1
  3. package/dist/adw/element-config.d.ts +3 -1
  4. package/dist/adw/element-config.d.ts.map +1 -1
  5. package/dist/adw/element-config.js +26 -36
  6. package/dist/adw/element-config.js.map +1 -1
  7. package/dist/components/window.d.ts.map +1 -1
  8. package/dist/components/window.js +13 -2
  9. package/dist/components/window.js.map +1 -1
  10. package/dist/config.d.ts +1 -1
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +1 -1
  13. package/dist/config.js.map +1 -1
  14. package/dist/element-config.d.ts.map +1 -1
  15. package/dist/element-config.js +3 -0
  16. package/dist/element-config.js.map +1 -1
  17. package/dist/hooks/use-signal.d.ts +4 -0
  18. package/dist/hooks/use-signal.d.ts.map +1 -1
  19. package/dist/hooks/use-signal.js +4 -0
  20. package/dist/hooks/use-signal.js.map +1 -1
  21. package/dist/internal.d.ts +1 -0
  22. package/dist/internal.d.ts.map +1 -1
  23. package/dist/internal.js +1 -0
  24. package/dist/internal.js.map +1 -1
  25. package/dist/reconciler/apply-props.d.ts.map +1 -1
  26. package/dist/reconciler/apply-props.js +12 -6
  27. package/dist/reconciler/apply-props.js.map +1 -1
  28. package/dist/reconciler/behaviors.d.ts.map +1 -1
  29. package/dist/reconciler/behaviors.js +7 -2
  30. package/dist/reconciler/behaviors.js.map +1 -1
  31. package/dist/reconciler/host-config.d.ts.map +1 -1
  32. package/dist/reconciler/host-config.js +2 -6
  33. package/dist/reconciler/host-config.js.map +1 -1
  34. package/dist/reconciler/placement.d.ts.map +1 -1
  35. package/dist/reconciler/placement.js +24 -8
  36. package/dist/reconciler/placement.js.map +1 -1
  37. package/dist/reconciler/registry.d.ts +22 -7
  38. package/dist/reconciler/registry.d.ts.map +1 -1
  39. package/dist/reconciler/registry.js +25 -15
  40. package/dist/reconciler/registry.js.map +1 -1
  41. package/dist/reconciler/root.d.ts +2 -2
  42. package/dist/reconciler/root.d.ts.map +1 -1
  43. package/dist/reconciler/root.js +1 -4
  44. package/dist/reconciler/root.js.map +1 -1
  45. package/dist/reconciler/signals.d.ts +3 -4
  46. package/dist/reconciler/signals.d.ts.map +1 -1
  47. package/dist/reconciler/signals.js +13 -25
  48. package/dist/reconciler/signals.js.map +1 -1
  49. package/dist/reconciler/text.d.ts.map +1 -1
  50. package/dist/reconciler/text.js +13 -8
  51. package/dist/reconciler/text.js.map +1 -1
  52. package/package.json +4 -4
  53. package/src/adw/element-behaviors.ts +6 -36
  54. package/src/adw/element-config.ts +27 -36
  55. package/src/components/window.tsx +15 -2
  56. package/src/config.ts +8 -1
  57. package/src/element-config.ts +3 -0
  58. package/src/hooks/use-signal.ts +4 -0
  59. package/src/internal.ts +1 -0
  60. package/src/reconciler/apply-props.ts +12 -6
  61. package/src/reconciler/behaviors.ts +8 -2
  62. package/src/reconciler/host-config.ts +2 -7
  63. package/src/reconciler/placement.ts +29 -9
  64. package/src/reconciler/registry.ts +31 -17
  65. package/src/reconciler/root.ts +3 -6
  66. package/src/reconciler/signals.ts +15 -36
  67. package/src/reconciler/text.ts +15 -8
@@ -1,7 +1,7 @@
1
1
  import * as Adw from "@gtkx/gi/adw";
2
2
  import { addRemoveSlot, adoptedChildrenSlot, boxSlot, childSetterSlot, contentSetterSlot, deferred, list, slot, } from "../reconciler/behaviors.js";
3
- import { registerElements } from "../reconciler/registry.js";
4
- import { BUILTIN_ELEMENTS } from "./element-config.js";
3
+ import { forTypes, registerElements } from "../reconciler/registry.js";
4
+ import { BUILTIN_ELEMENTS, CHILD_SETTER_TYPES, CONTENT_SETTER_TYPES } from "./element-config.js";
5
5
  const childSetter = childSetterSlot();
6
6
  const contentSetter = contentSetterSlot();
7
7
  const breakpoints = slot("breakpoints", "AdwBreakpoint", {
@@ -34,42 +34,12 @@ const pageHostChildren = addRemoveSlot("children", "AdwPreferencesPage", (host,
34
34
  });
35
35
  /** The runtime half of the built-in element configuration: the behaviors bound to each GObject type. */
36
36
  const BUILTIN_BEHAVIORS = {
37
- AdwBin: {
37
+ ...forTypes(CHILD_SETTER_TYPES, {
38
38
  behaviors: [childSetter],
39
- },
40
- AdwClamp: {
41
- behaviors: [childSetter],
42
- },
43
- AdwClampScrollable: {
44
- behaviors: [childSetter],
45
- },
46
- AdwNavigationPage: {
47
- behaviors: [childSetter],
48
- },
49
- AdwSplitButton: {
50
- behaviors: [childSetter],
51
- },
52
- AdwStatusPage: {
53
- behaviors: [childSetter],
54
- },
55
- AdwTabOverview: {
56
- behaviors: [childSetter],
57
- },
58
- AdwToastOverlay: {
59
- behaviors: [childSetter],
60
- },
61
- AdwToggle: {
62
- behaviors: [childSetter],
63
- },
64
- AdwBottomSheet: {
65
- behaviors: [contentSetter],
66
- },
67
- AdwFlap: {
68
- behaviors: [contentSetter],
69
- },
70
- AdwOverlaySplitView: {
39
+ }),
40
+ ...forTypes(CONTENT_SETTER_TYPES, {
71
41
  behaviors: [contentSetter],
72
- },
42
+ }),
73
43
  AdwDialog: {
74
44
  behaviors: [childSetter, breakpoints],
75
45
  },
@@ -1 +1 @@
1
- {"version":3,"file":"element-behaviors.js","sourceRoot":"","sources":["../../src/adw/element-behaviors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,IAAI,EACJ,IAAI,GACP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAsB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAoBvD,MAAM,WAAW,GAAG,eAAe,EAAkB,CAAC;AACtD,MAAM,aAAa,GAAG,iBAAiB,EAAoB,CAAC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AAW,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;oBAEhD,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;wBACpC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;oBACnE,CAAC;oBAED,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;wBACjC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;oBAC7D,CAAC;gBACL,CAAC;gBACD,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;oBACzB,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACvC,CAAC;aACJ,CAAC;SACL;KACJ;CACJ,CAAC;AAEF,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACnC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport * as Adw from \"@gtkx/gi/adw\";\nimport type { AlertDialogResponse } from \"./prop-types.js\";\nimport {\n addRemoveSlot,\n adoptedChildrenSlot,\n boxSlot,\n childSetterSlot,\n contentSetterSlot,\n deferred,\n list,\n slot,\n} from \"../reconciler/behaviors.js\";\nimport { type ElementConfig, registerElements } from \"../reconciler/registry.js\";\nimport { BUILTIN_ELEMENTS } from \"./element-config.js\";\n\ntype AdwChildSetter =\n | Adw.Bin |\n Adw.BreakpointBin |\n Adw.Clamp |\n Adw.ClampScrollable |\n Adw.Dialog |\n Adw.NavigationPage |\n Adw.SplitButton |\n Adw.StatusPage |\n Adw.TabOverview |\n Adw.ToastOverlay |\n Adw.Toggle;\n\ntype AdwContentSetter = Adw.ApplicationWindow | Adw.BottomSheet | Adw.Flap | Adw.OverlaySplitView | Adw.Window;\ntype BreakpointHost = Adw.ApplicationWindow | Adw.Window | Adw.Dialog;\ntype PageHost = Adw.PreferencesDialog | Adw.PreferencesWindow;\ntype PrefixSuffixRow = Adw.ActionRow | Adw.EntryRow | Adw.ExpanderRow;\n\nconst childSetter = childSetterSlot<AdwChildSetter>();\nconst contentSetter = contentSetterSlot<AdwContentSetter>();\n\nconst breakpoints = slot<BreakpointHost, Adw.Breakpoint>(\"breakpoints\", \"AdwBreakpoint\", {\n attach: (host, breakpoint) => {\n host.addBreakpoint(breakpoint);\n },\n});\n\nconst prefixSuffix = [\n slot<PrefixSuffixRow, Gtk.Widget>(\"prefix\", \"GtkWidget\", {\n attach: (row, child) => {\n row.addPrefix(child);\n },\n detach: (row, child) => {\n row.remove(child);\n },\n }),\n slot<PrefixSuffixRow, Gtk.Widget>(\"suffix\", \"GtkWidget\", {\n attach: (row, child) => {\n row.addSuffix(child);\n },\n detach: (row, child) => {\n row.remove(child);\n },\n }),\n];\n\nconst pageHostChildren = addRemoveSlot<Adw.PreferencesPage, PageHost>(\n \"children\",\n \"AdwPreferencesPage\",\n (host, page) => {\n host.add(page);\n },\n (host, page) => {\n host.remove(page);\n },\n);\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 AdwBin: {\n behaviors: [childSetter],\n },\n AdwClamp: {\n behaviors: [childSetter],\n },\n AdwClampScrollable: {\n behaviors: [childSetter],\n },\n AdwNavigationPage: {\n behaviors: [childSetter],\n },\n AdwSplitButton: {\n behaviors: [childSetter],\n },\n AdwStatusPage: {\n behaviors: [childSetter],\n },\n AdwTabOverview: {\n behaviors: [childSetter],\n },\n AdwToastOverlay: {\n behaviors: [childSetter],\n },\n AdwToggle: {\n behaviors: [childSetter],\n },\n AdwBottomSheet: {\n behaviors: [contentSetter],\n },\n AdwFlap: {\n behaviors: [contentSetter],\n },\n AdwOverlaySplitView: {\n behaviors: [contentSetter],\n },\n AdwDialog: {\n behaviors: [childSetter, breakpoints],\n },\n AdwApplicationWindow: {\n behaviors: [contentSetter, breakpoints],\n },\n AdwWindow: {\n behaviors: [contentSetter, breakpoints],\n },\n AdwBreakpointBin: {\n behaviors: [\n childSetter,\n addRemoveSlot<Adw.Breakpoint, Adw.BreakpointBin>(\n \"breakpoints\",\n \"AdwBreakpoint\",\n (bin, breakpoint) => {\n bin.addBreakpoint(breakpoint);\n },\n (bin, breakpoint) => {\n bin.removeBreakpoint(breakpoint);\n },\n ),\n ],\n },\n AdwActionRow: {\n behaviors: prefixSuffix,\n },\n AdwEntryRow: {\n behaviors: prefixSuffix,\n },\n AdwExpanderRow: {\n behaviors: [\n ...prefixSuffix,\n addRemoveSlot<Gtk.Widget, Adw.ExpanderRow>(\n \"rows\",\n \"GtkWidget\",\n (row, child) => {\n row.addRow(child);\n },\n (row, child) => {\n row.remove(child);\n },\n ),\n addRemoveSlot<Gtk.Widget, Adw.ExpanderRow>(\n \"actions\",\n \"GtkWidget\",\n (row, child) => {\n row.addAction(child);\n },\n (row, child) => {\n row.remove(child);\n },\n ),\n ],\n },\n AdwNavigationSplitView: {\n behaviors: [contentSetterSlot<Adw.NavigationSplitView, Adw.NavigationPage>(\"AdwNavigationPage\")],\n },\n AdwLeaflet: {\n behaviors: [boxSlot<Adw.Leaflet | Adw.WrapBox>()],\n },\n AdwWrapBox: {\n behaviors: [boxSlot<Adw.Leaflet | Adw.WrapBox>()],\n },\n AdwCarousel: {\n behaviors: [\n slot<Adw.Carousel, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (carousel, child, info) => {\n carousel.insert(child, info.index);\n },\n detach: (carousel, child) => {\n carousel.remove(child);\n },\n reorder: (carousel, child, info) => {\n carousel.reorder(child, info.index);\n },\n }),\n ],\n },\n AdwPreferencesPage: {\n behaviors: [\n slot<Adw.PreferencesPage, Adw.PreferencesGroup>(\"children\", \"AdwPreferencesGroup\", {\n attach: (page, group, info) => {\n page.insert(group, info.index);\n },\n detach: (page, group) => {\n page.remove(group);\n },\n }),\n ],\n },\n AdwPreferencesDialog: {\n behaviors: [pageHostChildren],\n },\n AdwPreferencesWindow: {\n behaviors: [pageHostChildren],\n },\n AdwPreferencesGroup: {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Adw.PreferencesGroup>(\n \"children\",\n \"GtkWidget\",\n (group, child) => {\n group.add(child);\n },\n (group, child) => {\n group.remove(child);\n },\n ),\n ],\n },\n AdwSqueezer: {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Adw.Squeezer>(\n \"children\",\n \"GtkWidget\",\n (squeezer, child) => {\n squeezer.add(child);\n },\n (squeezer, child) => {\n squeezer.remove(child);\n },\n ),\n ],\n },\n AdwTabView: {\n behaviors: [\n slot<Adw.TabView, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (view, child, info) => view.insert(child, info.index),\n reorder: (view, _child, info) => {\n if (info.adopted instanceof Adw.TabPage) {\n view.reorderPage(info.adopted, info.index);\n }\n },\n detach: (view, _child, info) => {\n if (info.adopted instanceof Adw.TabPage) {\n view.closePage(info.adopted);\n }\n },\n resolve: (view, child) => view.getPage(child),\n }),\n ],\n },\n AdwNavigationView: {\n behaviors: [\n addRemoveSlot<Adw.NavigationPage, Adw.NavigationView>(\n \"children\",\n \"AdwNavigationPage\",\n (view, page) => {\n view.add(page);\n },\n (view, page) => {\n view.remove(page);\n },\n ),\n ],\n },\n AdwViewStack: {\n behaviors: [\n adoptedChildrenSlot<Adw.ViewStack, Gtk.Widget>(\n \"GtkWidget\",\n (stack, child) => stack.add(child),\n (stack, child) => {\n stack.remove(child);\n },\n ),\n deferred<Adw.ViewStack, string>(\"visibleChildName\", (stack, name) => stack.getChildByName(name) !== null),\n ],\n },\n AdwToolbarView: {\n behaviors: [\n contentSetterSlot<Adw.ToolbarView>(),\n slot<Adw.ToolbarView, Gtk.Widget>(\"topBar\", \"GtkWidget\", {\n attach: (view, child) => {\n view.addTopBar(child);\n },\n detach: (view, child) => {\n view.remove(child);\n },\n }),\n slot<Adw.ToolbarView, Gtk.Widget>(\"bottomBar\", \"GtkWidget\", {\n attach: (view, child) => {\n view.addBottomBar(child);\n },\n detach: (view, child) => {\n view.remove(child);\n },\n }),\n ],\n },\n AdwHeaderBar: {\n behaviors: [\n slot<Adw.HeaderBar, Gtk.Widget>(\"start\", \"GtkWidget\", {\n attach: (bar, child) => {\n bar.packStart(child);\n },\n detach: (bar, child) => {\n bar.remove(child);\n },\n }),\n slot<Adw.HeaderBar, Gtk.Widget>(\"end\", \"GtkWidget\", {\n attach: (bar, child) => {\n bar.packEnd(child);\n },\n detach: (bar, child) => {\n bar.remove(child);\n },\n }),\n ],\n },\n AdwShortcutsDialog: {\n behaviors: [\n slot<Adw.ShortcutsDialog, Adw.ShortcutsSection>(\"children\", \"AdwShortcutsSection\", {\n attach: (dialog, section) => {\n dialog.add(section);\n },\n }),\n ],\n },\n AdwShortcutsSection: {\n behaviors: [\n slot<Adw.ShortcutsSection, Adw.ShortcutsItem>(\"children\", \"AdwShortcutsItem\", {\n attach: (section, item) => {\n section.add(item);\n },\n }),\n ],\n },\n AdwToggleGroup: {\n behaviors: [\n addRemoveSlot<Adw.Toggle, Adw.ToggleGroup>(\n \"children\",\n \"AdwToggle\",\n (group, toggle) => {\n group.add(toggle);\n },\n (group, toggle) => {\n group.remove(toggle);\n },\n ),\n deferred<Adw.ToggleGroup, string>(\"activeName\", (group, name) => group.getToggleByName(name) !== null),\n deferred(\"active\"),\n ],\n },\n AdwAlertDialog: {\n behaviors: [\n list<Adw.AlertDialog, AlertDialogResponse>(\"responses\", {\n add: (dialog, response) => {\n dialog.addResponse(response.id, response.label);\n\n if (response.appearance !== undefined) {\n dialog.setResponseAppearance(response.id, response.appearance);\n }\n\n if (response.enabled !== undefined) {\n dialog.setResponseEnabled(response.id, response.enabled);\n }\n },\n remove: (dialog, response) => {\n dialog.removeResponse(response.id);\n },\n }),\n ],\n },\n};\n\nregisterElements(BUILTIN_ELEMENTS);\nregisterElements(BUILTIN_BEHAVIORS);\n"]}
1
+ {"version":3,"file":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;oBAEhD,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;wBACpC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;oBACnE,CAAC;oBAED,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;wBACjC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;oBAC7D,CAAC;gBACL,CAAC;gBACD,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;oBACzB,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACvC,CAAC;aACJ,CAAC;SACL;KACJ;CACJ,CAAC;AAEF,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACnC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport * as Adw from \"@gtkx/gi/adw\";\nimport type { AlertDialogResponse } from \"./prop-types.js\";\nimport {\n addRemoveSlot,\n adoptedChildrenSlot,\n boxSlot,\n childSetterSlot,\n contentSetterSlot,\n deferred,\n list,\n slot,\n} from \"../reconciler/behaviors.js\";\nimport { type ElementConfig, forTypes, registerElements } from \"../reconciler/registry.js\";\nimport { BUILTIN_ELEMENTS, CHILD_SETTER_TYPES, CONTENT_SETTER_TYPES } from \"./element-config.js\";\n\ntype AdwChildSetter =\n | Adw.Bin |\n Adw.BreakpointBin |\n Adw.Clamp |\n Adw.ClampScrollable |\n Adw.Dialog |\n Adw.NavigationPage |\n Adw.SplitButton |\n Adw.StatusPage |\n Adw.TabOverview |\n Adw.ToastOverlay |\n Adw.Toggle;\n\ntype AdwContentSetter = Adw.ApplicationWindow | Adw.BottomSheet | Adw.Flap | Adw.OverlaySplitView | Adw.Window;\ntype BreakpointHost = Adw.ApplicationWindow | Adw.Window | Adw.Dialog;\ntype PageHost = Adw.PreferencesDialog | Adw.PreferencesWindow;\ntype PrefixSuffixRow = Adw.ActionRow | Adw.EntryRow | Adw.ExpanderRow;\n\nconst childSetter = childSetterSlot<AdwChildSetter>();\nconst contentSetter = contentSetterSlot<AdwContentSetter>();\n\nconst breakpoints = slot<BreakpointHost, Adw.Breakpoint>(\"breakpoints\", \"AdwBreakpoint\", {\n attach: (host, breakpoint) => {\n host.addBreakpoint(breakpoint);\n },\n});\n\nconst prefixSuffix = [\n slot<PrefixSuffixRow, Gtk.Widget>(\"prefix\", \"GtkWidget\", {\n attach: (row, child) => {\n row.addPrefix(child);\n },\n detach: (row, child) => {\n row.remove(child);\n },\n }),\n slot<PrefixSuffixRow, Gtk.Widget>(\"suffix\", \"GtkWidget\", {\n attach: (row, child) => {\n row.addSuffix(child);\n },\n detach: (row, child) => {\n row.remove(child);\n },\n }),\n];\n\nconst pageHostChildren = addRemoveSlot<Adw.PreferencesPage, PageHost>(\n \"children\",\n \"AdwPreferencesPage\",\n (host, page) => {\n host.add(page);\n },\n (host, page) => {\n host.remove(page);\n },\n);\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(CHILD_SETTER_TYPES, {\n behaviors: [childSetter],\n }),\n ...forTypes(CONTENT_SETTER_TYPES, {\n behaviors: [contentSetter],\n }),\n AdwDialog: {\n behaviors: [childSetter, breakpoints],\n },\n AdwApplicationWindow: {\n behaviors: [contentSetter, breakpoints],\n },\n AdwWindow: {\n behaviors: [contentSetter, breakpoints],\n },\n AdwBreakpointBin: {\n behaviors: [\n childSetter,\n addRemoveSlot<Adw.Breakpoint, Adw.BreakpointBin>(\n \"breakpoints\",\n \"AdwBreakpoint\",\n (bin, breakpoint) => {\n bin.addBreakpoint(breakpoint);\n },\n (bin, breakpoint) => {\n bin.removeBreakpoint(breakpoint);\n },\n ),\n ],\n },\n AdwActionRow: {\n behaviors: prefixSuffix,\n },\n AdwEntryRow: {\n behaviors: prefixSuffix,\n },\n AdwExpanderRow: {\n behaviors: [\n ...prefixSuffix,\n addRemoveSlot<Gtk.Widget, Adw.ExpanderRow>(\n \"rows\",\n \"GtkWidget\",\n (row, child) => {\n row.addRow(child);\n },\n (row, child) => {\n row.remove(child);\n },\n ),\n addRemoveSlot<Gtk.Widget, Adw.ExpanderRow>(\n \"actions\",\n \"GtkWidget\",\n (row, child) => {\n row.addAction(child);\n },\n (row, child) => {\n row.remove(child);\n },\n ),\n ],\n },\n AdwNavigationSplitView: {\n behaviors: [contentSetterSlot<Adw.NavigationSplitView, Adw.NavigationPage>(\"AdwNavigationPage\")],\n },\n AdwLeaflet: {\n behaviors: [boxSlot<Adw.Leaflet | Adw.WrapBox>()],\n },\n AdwWrapBox: {\n behaviors: [boxSlot<Adw.Leaflet | Adw.WrapBox>()],\n },\n AdwCarousel: {\n behaviors: [\n slot<Adw.Carousel, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (carousel, child, info) => {\n carousel.insert(child, info.index);\n },\n detach: (carousel, child) => {\n carousel.remove(child);\n },\n reorder: (carousel, child, info) => {\n carousel.reorder(child, info.index);\n },\n }),\n ],\n },\n AdwPreferencesPage: {\n behaviors: [\n slot<Adw.PreferencesPage, Adw.PreferencesGroup>(\"children\", \"AdwPreferencesGroup\", {\n attach: (page, group, info) => {\n page.insert(group, info.index);\n },\n detach: (page, group) => {\n page.remove(group);\n },\n }),\n ],\n },\n AdwPreferencesDialog: {\n behaviors: [pageHostChildren],\n },\n AdwPreferencesWindow: {\n behaviors: [pageHostChildren],\n },\n AdwPreferencesGroup: {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Adw.PreferencesGroup>(\n \"children\",\n \"GtkWidget\",\n (group, child) => {\n group.add(child);\n },\n (group, child) => {\n group.remove(child);\n },\n ),\n ],\n },\n AdwSqueezer: {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Adw.Squeezer>(\n \"children\",\n \"GtkWidget\",\n (squeezer, child) => {\n squeezer.add(child);\n },\n (squeezer, child) => {\n squeezer.remove(child);\n },\n ),\n ],\n },\n AdwTabView: {\n behaviors: [\n slot<Adw.TabView, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (view, child, info) => view.insert(child, info.index),\n reorder: (view, _child, info) => {\n if (info.adopted instanceof Adw.TabPage) {\n view.reorderPage(info.adopted, info.index);\n }\n },\n detach: (view, _child, info) => {\n if (info.adopted instanceof Adw.TabPage) {\n view.closePage(info.adopted);\n }\n },\n resolve: (view, child) => view.getPage(child),\n }),\n ],\n },\n AdwNavigationView: {\n behaviors: [\n addRemoveSlot<Adw.NavigationPage, Adw.NavigationView>(\n \"children\",\n \"AdwNavigationPage\",\n (view, page) => {\n view.add(page);\n },\n (view, page) => {\n view.remove(page);\n },\n ),\n ],\n },\n AdwViewStack: {\n behaviors: [\n adoptedChildrenSlot<Adw.ViewStack, Gtk.Widget>(\n \"GtkWidget\",\n (stack, child) => stack.add(child),\n (stack, child) => {\n stack.remove(child);\n },\n ),\n deferred<Adw.ViewStack, string>(\"visibleChildName\", (stack, name) => stack.getChildByName(name) !== null),\n ],\n },\n AdwToolbarView: {\n behaviors: [\n contentSetterSlot<Adw.ToolbarView>(),\n slot<Adw.ToolbarView, Gtk.Widget>(\"topBar\", \"GtkWidget\", {\n attach: (view, child) => {\n view.addTopBar(child);\n },\n detach: (view, child) => {\n view.remove(child);\n },\n }),\n slot<Adw.ToolbarView, Gtk.Widget>(\"bottomBar\", \"GtkWidget\", {\n attach: (view, child) => {\n view.addBottomBar(child);\n },\n detach: (view, child) => {\n view.remove(child);\n },\n }),\n ],\n },\n AdwHeaderBar: {\n behaviors: [\n slot<Adw.HeaderBar, Gtk.Widget>(\"start\", \"GtkWidget\", {\n attach: (bar, child) => {\n bar.packStart(child);\n },\n detach: (bar, child) => {\n bar.remove(child);\n },\n }),\n slot<Adw.HeaderBar, Gtk.Widget>(\"end\", \"GtkWidget\", {\n attach: (bar, child) => {\n bar.packEnd(child);\n },\n detach: (bar, child) => {\n bar.remove(child);\n },\n }),\n ],\n },\n AdwShortcutsDialog: {\n behaviors: [\n slot<Adw.ShortcutsDialog, Adw.ShortcutsSection>(\"children\", \"AdwShortcutsSection\", {\n attach: (dialog, section) => {\n dialog.add(section);\n },\n }),\n ],\n },\n AdwShortcutsSection: {\n behaviors: [\n slot<Adw.ShortcutsSection, Adw.ShortcutsItem>(\"children\", \"AdwShortcutsItem\", {\n attach: (section, item) => {\n section.add(item);\n },\n }),\n ],\n },\n AdwToggleGroup: {\n behaviors: [\n addRemoveSlot<Adw.Toggle, Adw.ToggleGroup>(\n \"children\",\n \"AdwToggle\",\n (group, toggle) => {\n group.add(toggle);\n },\n (group, toggle) => {\n group.remove(toggle);\n },\n ),\n deferred<Adw.ToggleGroup, string>(\"activeName\", (group, name) => group.getToggleByName(name) !== null),\n deferred(\"active\"),\n ],\n },\n AdwAlertDialog: {\n behaviors: [\n list<Adw.AlertDialog, AlertDialogResponse>(\"responses\", {\n add: (dialog, response) => {\n dialog.addResponse(response.id, response.label);\n\n if (response.appearance !== undefined) {\n dialog.setResponseAppearance(response.id, response.appearance);\n }\n\n if (response.enabled !== undefined) {\n dialog.setResponseEnabled(response.id, response.enabled);\n }\n },\n remove: (dialog, response) => {\n dialog.removeResponse(response.id);\n },\n }),\n ],\n },\n};\n\nregisterElements(BUILTIN_ELEMENTS);\nregisterElements(BUILTIN_BEHAVIORS);\n"]}
@@ -1,9 +1,11 @@
1
1
  import { type ElementConfig } from "../reconciler/registry.js";
2
+ declare const CHILD_SETTER_TYPES: string[];
3
+ declare const CONTENT_SETTER_TYPES: string[];
2
4
  /**
3
5
  * The static, runtime-free half of the built-in element configuration: which base props interface each
4
6
  * generated element extends, which component wraps it, and whether its GObject is created lazily by its
5
7
  * parent. Codegen imports this module, so it must never reach the GObject bindings.
6
8
  */
7
9
  declare const BUILTIN_ELEMENTS: Record<string, ElementConfig>;
8
- export { BUILTIN_ELEMENTS };
10
+ export { CHILD_SETTER_TYPES, CONTENT_SETTER_TYPES, BUILTIN_ELEMENTS };
9
11
  //# sourceMappingURL=element-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"element-config.d.ts","sourceRoot":"","sources":["../../src/adw/element-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA+B,MAAM,2BAA2B,CAAC;AAM5F;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CA0HnD,CAAC;AAMF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"element-config.d.ts","sourceRoot":"","sources":["../../src/adw/element-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAyC,MAAM,2BAA2B,CAAC;AAEtG,QAAA,MAAM,kBAAkB,EAAE,MAAM,EAU/B,CAAC;AAEF,QAAA,MAAM,oBAAoB,EAAE,MAAM,EAAyD,CAAC;AAK5F;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAoGnD,CAAC;AAMF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,4 +1,16 @@
1
- import { internal } from "../reconciler/registry.js";
1
+ import { forTypes, internal } from "../reconciler/registry.js";
2
+ const CHILD_SETTER_TYPES = [
3
+ "AdwBin",
4
+ "AdwClamp",
5
+ "AdwClampScrollable",
6
+ "AdwNavigationPage",
7
+ "AdwSplitButton",
8
+ "AdwStatusPage",
9
+ "AdwTabOverview",
10
+ "AdwToastOverlay",
11
+ "AdwToggle",
12
+ ];
13
+ const CONTENT_SETTER_TYPES = ["AdwBottomSheet", "AdwFlap", "AdwOverlaySplitView"];
2
14
  const childrenProps = internal("ChildrenProps");
3
15
  const breakpointsProps = adw("AdwBreakpointsProps");
4
16
  const preferencesRowProps = adw("AdwPreferencesRowProps");
@@ -8,42 +20,14 @@ const preferencesRowProps = adw("AdwPreferencesRowProps");
8
20
  * parent. Codegen imports this module, so it must never reach the GObject bindings.
9
21
  */
10
22
  const BUILTIN_ELEMENTS = {
11
- AdwBin: {
23
+ ...forTypes(CHILD_SETTER_TYPES, {
12
24
  props: childrenProps,
13
- },
14
- AdwClamp: {
15
- props: childrenProps,
16
- },
17
- AdwClampScrollable: {
18
- props: childrenProps,
19
- },
20
- AdwNavigationPage: {
21
- props: childrenProps,
22
- },
23
- AdwSplitButton: {
24
- props: childrenProps,
25
- },
26
- AdwStatusPage: {
27
- props: childrenProps,
28
- },
29
- AdwTabOverview: {
25
+ omitProps: ["child"],
26
+ }),
27
+ ...forTypes(CONTENT_SETTER_TYPES, {
30
28
  props: childrenProps,
31
- },
32
- AdwToastOverlay: {
33
- props: childrenProps,
34
- },
35
- AdwToggle: {
36
- props: childrenProps,
37
- },
38
- AdwBottomSheet: {
39
- props: childrenProps,
40
- },
41
- AdwFlap: {
42
- props: childrenProps,
43
- },
44
- AdwOverlaySplitView: {
45
- props: childrenProps,
46
- },
29
+ omitProps: ["content"],
30
+ }),
47
31
  AdwViewStackPage: {
48
32
  lazy: true,
49
33
  },
@@ -56,15 +40,19 @@ const BUILTIN_ELEMENTS = {
56
40
  AdwDialog: {
57
41
  props: breakpointsProps,
58
42
  component: adw("createDialogComponent"),
43
+ omitProps: ["child"],
59
44
  },
60
45
  AdwApplicationWindow: {
61
46
  props: breakpointsProps,
47
+ omitProps: ["content"],
62
48
  },
63
49
  AdwWindow: {
64
50
  props: breakpointsProps,
51
+ omitProps: ["content"],
65
52
  },
66
53
  AdwBreakpointBin: {
67
54
  props: breakpointsProps,
55
+ omitProps: ["child"],
68
56
  },
69
57
  AdwActionRow: {
70
58
  props: preferencesRowProps,
@@ -77,6 +65,7 @@ const BUILTIN_ELEMENTS = {
77
65
  },
78
66
  AdwNavigationSplitView: {
79
67
  props: childrenProps,
68
+ omitProps: ["content"],
80
69
  },
81
70
  AdwLeaflet: {
82
71
  props: childrenProps,
@@ -113,6 +102,7 @@ const BUILTIN_ELEMENTS = {
113
102
  },
114
103
  AdwToolbarView: {
115
104
  props: adw("AdwToolbarViewProps"),
105
+ omitProps: ["content"],
116
106
  },
117
107
  AdwHeaderBar: {
118
108
  props: internal("GtkHeaderBarProps"),
@@ -133,5 +123,5 @@ const BUILTIN_ELEMENTS = {
133
123
  function adw(name) {
134
124
  return { module: "@gtkx/react/adw", export: name };
135
125
  }
136
- export { BUILTIN_ELEMENTS };
126
+ export { CHILD_SETTER_TYPES, CONTENT_SETTER_TYPES, BUILTIN_ELEMENTS };
137
127
  //# sourceMappingURL=element-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"element-config.js","sourceRoot":"","sources":["../../src/adw/element-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAqB,MAAM,2BAA2B,CAAC;AAE5F,MAAM,aAAa,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAChD,MAAM,gBAAgB,GAAG,GAAG,CAAC,qBAAqB,CAAC,CAAC;AACpD,MAAM,mBAAmB,GAAG,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,gBAAgB,GAAkC;IACpD,MAAM,EAAE;QACJ,KAAK,EAAE,aAAa;KACvB;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,aAAa;KACvB;IACD,kBAAkB,EAAE;QAChB,KAAK,EAAE,aAAa;KACvB;IACD,iBAAiB,EAAE;QACf,KAAK,EAAE,aAAa;KACvB;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,aAAa;KACvB;IACD,aAAa,EAAE;QACX,KAAK,EAAE,aAAa;KACvB;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,aAAa;KACvB;IACD,eAAe,EAAE;QACb,KAAK,EAAE,aAAa;KACvB;IACD,SAAS,EAAE;QACP,KAAK,EAAE,aAAa;KACvB;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,aAAa;KACvB;IACD,OAAO,EAAE;QACL,K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,GAAG,CAAC,qBAAqB,CAAC;KACpC;IACD,YAAY,EAAE;QACV,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC;KACvC;IACD,kBAAkB,EAAE;QAChB,KAAK,EAAE,aAAa;KACvB;IACD,mBAAmB,EAAE;QACjB,KAAK,EAAE,aAAa;KACvB;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,aAAa;KACvB;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,GAAG,CAAC,qBAAqB,CAAC;KACpC;CACJ,CAAC;AAEF,SAAS,GAAG,CAAC,IAAY;IACrB,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACvD,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { type ElementConfig, internal, type ModuleExport } from \"../reconciler/registry.js\";\n\nconst childrenProps = internal(\"ChildrenProps\");\nconst breakpointsProps = adw(\"AdwBreakpointsProps\");\nconst preferencesRowProps = adw(\"AdwPreferencesRowProps\");\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 AdwBin: {\n props: childrenProps,\n },\n AdwClamp: {\n props: childrenProps,\n },\n AdwClampScrollable: {\n props: childrenProps,\n },\n AdwNavigationPage: {\n props: childrenProps,\n },\n AdwSplitButton: {\n props: childrenProps,\n },\n AdwStatusPage: {\n props: childrenProps,\n },\n AdwTabOverview: {\n props: childrenProps,\n },\n AdwToastOverlay: {\n props: childrenProps,\n },\n AdwToggle: {\n props: childrenProps,\n },\n AdwBottomSheet: {\n props: childrenProps,\n },\n AdwFlap: {\n props: childrenProps,\n },\n AdwOverlaySplitView: {\n props: childrenProps,\n },\n AdwViewStackPage: {\n lazy: true,\n },\n AdwTabPage: {\n lazy: true,\n },\n AdwPreferencesRow: {\n props: preferencesRowProps,\n },\n AdwDialog: {\n props: breakpointsProps,\n component: adw(\"createDialogComponent\"),\n },\n AdwApplicationWindow: {\n props: breakpointsProps,\n },\n AdwWindow: {\n props: breakpointsProps,\n },\n AdwBreakpointBin: {\n props: breakpointsProps,\n },\n AdwActionRow: {\n props: preferencesRowProps,\n },\n AdwEntryRow: {\n props: preferencesRowProps,\n },\n AdwExpanderRow: {\n props: adw(\"AdwExpanderRowProps\"),\n },\n AdwNavigationSplitView: {\n props: childrenProps,\n },\n AdwLeaflet: {\n props: childrenProps,\n },\n AdwWrapBox: {\n props: childrenProps,\n },\n AdwCarousel: {\n props: childrenProps,\n },\n AdwPreferencesPage: {\n props: childrenProps,\n },\n AdwPreferencesDialog: {\n props: childrenProps,\n },\n AdwPreferencesWindow: {\n props: childrenProps,\n },\n AdwPreferencesGroup: {\n props: childrenProps,\n },\n AdwSqueezer: {\n props: childrenProps,\n },\n AdwTabView: {\n props: childrenProps,\n },\n AdwNavigationView: {\n props: childrenProps,\n },\n AdwViewStack: {\n props: childrenProps,\n },\n AdwToolbarView: {\n props: adw(\"AdwToolbarViewProps\"),\n },\n AdwHeaderBar: {\n props: internal(\"GtkHeaderBarProps\"),\n },\n AdwShortcutsDialog: {\n props: childrenProps,\n },\n AdwShortcutsSection: {\n props: childrenProps,\n },\n AdwToggleGroup: {\n props: childrenProps,\n },\n AdwAlertDialog: {\n props: adw(\"AdwAlertDialogProps\"),\n },\n};\n\nfunction adw(name: string): ModuleExport {\n return { module: \"@gtkx/react/adw\", export: name };\n}\n\nexport { BUILTIN_ELEMENTS };\n"]}
1
+ {"version":3,"file":"element-config.js","sourceRoot":"","sources":["../../src/adw/element-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAE,QAAQ,EAAqB,MAAM,2BAA2B,CAAC;AAEtG,MAAM,kBAAkB,GAAa;IACjC,QAAQ;IACR,UAAU;IACV,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;IAChB,eAAe;IACf,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ementConfig, forTypes, internal, type ModuleExport } from \"../reconciler/registry.js\";\n\nconst CHILD_SETTER_TYPES: string[] = [\n \"AdwBin\",\n \"AdwClamp\",\n \"AdwClampScrollable\",\n \"AdwNavigationPage\",\n \"AdwSplitButton\",\n \"AdwStatusPage\",\n \"AdwTabOverview\",\n \"AdwToastOverlay\",\n \"AdwToggle\",\n];\n\nconst CONTENT_SETTER_TYPES: string[] = [\"AdwBottomSheet\", \"AdwFlap\", \"AdwOverlaySplitView\"];\nconst childrenProps = internal(\"ChildrenProps\");\nconst breakpointsProps = adw(\"AdwBreakpointsProps\");\nconst preferencesRowProps = adw(\"AdwPreferencesRowProps\");\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(CHILD_SETTER_TYPES, {\n props: childrenProps,\n omitProps: [\"child\"],\n }),\n ...forTypes(CONTENT_SETTER_TYPES, {\n props: childrenProps,\n omitProps: [\"content\"],\n }),\n AdwViewStackPage: {\n lazy: true,\n },\n AdwTabPage: {\n lazy: true,\n },\n AdwPreferencesRow: {\n props: preferencesRowProps,\n },\n AdwDialog: {\n props: breakpointsProps,\n component: adw(\"createDialogComponent\"),\n omitProps: [\"child\"],\n },\n AdwApplicationWindow: {\n props: breakpointsProps,\n omitProps: [\"content\"],\n },\n AdwWindow: {\n props: breakpointsProps,\n omitProps: [\"content\"],\n },\n AdwBreakpointBin: {\n props: breakpointsProps,\n omitProps: [\"child\"],\n },\n AdwActionRow: {\n props: preferencesRowProps,\n },\n AdwEntryRow: {\n props: preferencesRowProps,\n },\n AdwExpanderRow: {\n props: adw(\"AdwExpanderRowProps\"),\n },\n AdwNavigationSplitView: {\n props: childrenProps,\n omitProps: [\"content\"],\n },\n AdwLeaflet: {\n props: childrenProps,\n },\n AdwWrapBox: {\n props: childrenProps,\n },\n AdwCarousel: {\n props: childrenProps,\n },\n AdwPreferencesPage: {\n props: childrenProps,\n },\n AdwPreferencesDialog: {\n props: childrenProps,\n },\n AdwPreferencesWindow: {\n props: childrenProps,\n },\n AdwPreferencesGroup: {\n props: childrenProps,\n },\n AdwSqueezer: {\n props: childrenProps,\n },\n AdwTabView: {\n props: childrenProps,\n },\n AdwNavigationView: {\n props: childrenProps,\n },\n AdwViewStack: {\n props: childrenProps,\n },\n AdwToolbarView: {\n props: adw(\"AdwToolbarViewProps\"),\n omitProps: [\"content\"],\n },\n AdwHeaderBar: {\n props: internal(\"GtkHeaderBarProps\"),\n },\n AdwShortcutsDialog: {\n props: childrenProps,\n },\n AdwShortcutsSection: {\n props: childrenProps,\n },\n AdwToggleGroup: {\n props: childrenProps,\n },\n AdwAlertDialog: {\n props: adw(\"AdwAlertDialogProps\"),\n },\n};\n\nfunction adw(name: string): ModuleExport {\n return { module: \"@gtkx/react/adw\", export: name };\n}\n\nexport { CHILD_SETTER_TYPES, CONTENT_SETTER_TYPES, BUILTIN_ELEMENTS };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/components/window.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAA6B,MAAM,OAAO,CAAC;AAI9F,KAAK,oBAAoB,GAAG;IACxB,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,QAAA,MAAM,qBAAqB,GAAI,WAAW,WAAW,KAAG,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAuBlG,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/components/window.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAA6B,MAAM,OAAO,CAAC;AAK9F,KAAK,oBAAoB,GAAG;IACxB,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5C,CAAC;AAcF,QAAA,MAAM,qBAAqB,GAAI,WAAW,WAAW,KAAG,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAuBlG,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -2,6 +2,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useLayoutEffect, useState } from "react";
3
3
  import { useMergedRef } from "../hooks/use-merged-refs.js";
4
4
  import { ParentWindowContext } from "../hooks/use-parent-window.js";
5
+ import { applyWrite } from "../reconciler/signals.js";
6
+ const presentWindow = (window) => {
7
+ applyWrite(() => {
8
+ window.present();
9
+ });
10
+ };
11
+ const destroyWindow = (window) => {
12
+ applyWrite(() => {
13
+ window.destroy();
14
+ });
15
+ };
5
16
  const createWindowComponent = (Component) => {
6
17
  return ({ ref, ...rest }) => {
7
18
  const [window, setWindow] = useState(null);
@@ -10,9 +21,9 @@ const createWindowComponent = (Component) => {
10
21
  if (!window) {
11
22
  return;
12
23
  }
13
- window.present();
24
+ presentWindow(window);
14
25
  return () => {
15
- window.destroy();
26
+ destroyWindow(window);
16
27
  };
17
28
  }, [window]);
18
29
  return (_jsx(ParentWindowContext.Provider, { value: window, children: _jsx(Component, { ref: mergedRef, ...rest }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"window.js","sourceRoot":"","sources":["../../src/components/window.tsx"],"names":[],"mappings":";AACA,OAAO,EAA8C,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAMpE,MAAM,qBAAqB,GAAG,CAAC,SAAsB,EAAgD,EAAE;IACnG,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAwB,EAAa,EAAE;QACzD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAoB,IAAI,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE/C,eAAe,CAAC,GAAG,EAAE;YACjB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,OAAO;YACX,CAAC;YAED,MAAM,CAAC,OAAO,EAAE,CAAC;YAEjB,OAAO,GAAG,EAAE;gBACR,MAAM,CAAC,OAAO,EAAE,CAAC;YACrB,CAAC,CAAC;QACN,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAEb,OAAO,CACH,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACvC,KAAC,SAAS,IAAC,GAAG,EAAE,SAAS,KAAM,IAAI,GAAI,GACZ,CAClC,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport { type ElementType, type ReactNode, type Ref, useLayoutEffect, useState } from \"react\";\nimport { useMergedRef } from \"../hooks/use-merged-refs.js\";\nimport { ParentWindowContext } from \"../hooks/use-parent-window.js\";\n\ntype WindowComponentProps = {\n ref?: Ref<Gtk.Window | null> | undefined;\n};\n\nconst createWindowComponent = (Component: ElementType): ((props: WindowComponentProps) => ReactNode) => {\n return ({ ref, ...rest }: WindowComponentProps): ReactNode => {\n const [window, setWindow] = useState<Gtk.Window | null>(null);\n const mergedRef = useMergedRef(ref, setWindow);\n\n useLayoutEffect(() => {\n if (!window) {\n return;\n }\n\n window.present();\n\n return () => {\n window.destroy();\n };\n }, [window]);\n\n return (\n <ParentWindowContext.Provider value={window}>\n <Component ref={mergedRef} {...rest} />\n </ParentWindowContext.Provider>\n );\n };\n};\n\nexport { createWindowComponent };\n"]}
1
+ {"version":3,"file":"window.js","sourceRoot":"","sources":["../../src/components/window.tsx"],"names":[],"mappings":";AACA,OAAO,EAA8C,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAMtD,MAAM,aAAa,GAAG,CAAC,MAAkB,EAAQ,EAAE;IAC/C,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,MAAkB,EAAQ,EAAE;IAC/C,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,SAAsB,EAAgD,EAAE;IACnG,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAwB,EAAa,EAAE;QACzD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAoB,IAAI,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE/C,eAAe,CAAC,GAAG,EAAE;YACjB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,OAAO;YACX,CAAC;YAED,aAAa,CAAC,MAAM,CAAC,CAAC;YAEtB,OAAO,GAAG,EAAE;gBACR,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC,CAAC;QACN,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAEb,OAAO,CACH,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACvC,KAAC,SAAS,IAAC,GAAG,EAAE,SAAS,KAAM,IAAI,GAAI,GACZ,CAClC,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport { type ElementType, type ReactNode, type Ref, useLayoutEffect, useState } from \"react\";\nimport { useMergedRef } from \"../hooks/use-merged-refs.js\";\nimport { ParentWindowContext } from \"../hooks/use-parent-window.js\";\nimport { applyWrite } from \"../reconciler/signals.js\";\n\ntype WindowComponentProps = {\n ref?: Ref<Gtk.Window | null> | undefined;\n};\n\nconst presentWindow = (window: Gtk.Window): void => {\n applyWrite(() => {\n window.present();\n });\n};\n\nconst destroyWindow = (window: Gtk.Window): void => {\n applyWrite(() => {\n window.destroy();\n });\n};\n\nconst createWindowComponent = (Component: ElementType): ((props: WindowComponentProps) => ReactNode) => {\n return ({ ref, ...rest }: WindowComponentProps): ReactNode => {\n const [window, setWindow] = useState<Gtk.Window | null>(null);\n const mergedRef = useMergedRef(ref, setWindow);\n\n useLayoutEffect(() => {\n if (!window) {\n return;\n }\n\n presentWindow(window);\n\n return () => {\n destroyWindow(window);\n };\n }, [window]);\n\n return (\n <ParentWindowContext.Provider value={window}>\n <Component ref={mergedRef} {...rest} />\n </ParentWindowContext.Provider>\n );\n };\n};\n\nexport { createWindowComponent };\n"]}
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { BUILTIN_ELEMENTS } from "./element-config.js";
2
2
  export type { DetachInfo, ElementBehavior, ElementConfig, ModuleExport, PlaceInfo } from "./reconciler/registry.js";
3
- export { defineElements, ELEMENTS, forTypes, internal, mergeElementConfigs } from "./reconciler/registry.js";
3
+ export { defineBehavior, defineElements, ELEMENTS, forTypes, internal, mergeElementConfigs, } from "./reconciler/registry.js";
4
4
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACpH,OAAO,EACH,cAAc,EACd,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,mBAAmB,GACtB,MAAM,0BAA0B,CAAC"}
package/dist/config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { BUILTIN_ELEMENTS } from "./element-config.js";
2
- export { defineElements, ELEMENTS, forTypes, internal, mergeElementConfigs } from "./reconciler/registry.js";
2
+ export { defineBehavior, defineElements, ELEMENTS, forTypes, internal, mergeElementConfigs, } from "./reconciler/registry.js";
3
3
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { BUILTIN_ELEMENTS } from \"./element-config.js\";\nexport type { DetachInfo, ElementBehavior, ElementConfig, ModuleExport, PlaceInfo } from \"./reconciler/registry.js\";\nexport { defineElements, ELEMENTS, forTypes, internal, mergeElementConfigs } from \"./reconciler/registry.js\";\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EACH,cAAc,EACd,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,mBAAmB,GACtB,MAAM,0BAA0B,CAAC","sourcesContent":["export { BUILTIN_ELEMENTS } from \"./element-config.js\";\nexport type { DetachInfo, ElementBehavior, ElementConfig, ModuleExport, PlaceInfo } from \"./reconciler/registry.js\";\nexport {\n defineBehavior,\n defineElements,\n ELEMENTS,\n forTypes,\n internal,\n mergeElementConfigs,\n} from \"./reconciler/registry.js\";\n"]}
@@ -1 +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"}
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,CAqHnD,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -30,6 +30,7 @@ const SINGLE_CHILD_TYPES = [
30
30
  const BUILTIN_ELEMENTS = {
31
31
  ...forTypes(SINGLE_CHILD_TYPES, {
32
32
  props: internal("ChildrenProps"),
33
+ omitProps: ["child"],
33
34
  }),
34
35
  ...forTypes(["GtkHeaderBar", "GtkActionBar"], {
35
36
  props: internal("GtkHeaderBarProps"),
@@ -37,6 +38,7 @@ const BUILTIN_ELEMENTS = {
37
38
  GtkWindow: {
38
39
  props: internal("ChildrenProps"),
39
40
  component: internal("createWindowComponent"),
41
+ omitProps: ["child"],
40
42
  },
41
43
  GtkLabel: {
42
44
  props: internal("ChildrenProps"),
@@ -82,6 +84,7 @@ const BUILTIN_ELEMENTS = {
82
84
  },
83
85
  GtkOverlay: {
84
86
  props: internal("GtkOverlayProps"),
87
+ omitProps: ["child"],
85
88
  },
86
89
  GtkShortcutController: {
87
90
  props: internal("GtkShortcutControllerProps"),
@@ -1 +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,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ciler/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
+ {"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;IACp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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 omitProps: [\"child\"],\n }),\n ...forTypes([\"GtkHeaderBar\", \"GtkActionBar\"], {\n props: internal(\"GtkHeaderBarProps\"),\n }),\n GtkWindow: {\n props: internal(\"ChildrenProps\"),\n component: internal(\"createWindowComponent\"),\n omitProps: [\"child\"],\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 omitProps: [\"child\"],\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"]}
@@ -14,6 +14,10 @@ type UseSignalOptions = {
14
14
  * Each emission runs the handler from the latest render, so it does not have to be stable and a
15
15
  * changing handler never reconnects the signal.
16
16
  *
17
+ * On React 19.2 this does not hold inside a component wrapped in `memo` or `forwardRef`, where every emission
18
+ * runs the handler captured on the first render. Keep the calling component unwrapped, or read the values the
19
+ * handler needs off the GObject itself. React fixes this on the 19.3 line.
20
+ *
17
21
  * @param object The GObject (or ref to one) to connect to.
18
22
  * @param signal The signal name, optionally with a detail suffix.
19
23
  * @param handler The callback invoked when the signal is emitted.
@@ -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;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,CA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G,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;;;;;;;;;;;;;;GAcG;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"}
@@ -6,6 +6,10 @@ import { resolveRefProp } from "../utils/ref-prop.js";
6
6
  * Each emission runs the handler from the latest render, so it does not have to be stable and a
7
7
  * changing handler never reconnects the signal.
8
8
  *
9
+ * On React 19.2 this does not hold inside a component wrapped in `memo` or `forwardRef`, where every emission
10
+ * runs the handler captured on the first render. Keep the calling component unwrapped, or read the values the
11
+ * handler needs off the GObject itself. React fixes this on the 19.3 line.
12
+ *
9
13
  * @param object The GObject (or ref to one) to connect to.
10
14
  * @param signal The signal name, optionally with a detail suffix.
11
15
  * @param handler The callback invoked when the signal is emitted.
@@ -1 +1 @@
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"]}
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;;;;;;;;;;;;;;GAcG;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 * On React 19.2 this does not hold inside a component wrapped in `memo` or `forwardRef`, where every emission\n * runs the handler captured on the first render. Keep the calling component unwrapped, or read the values the\n * handler needs off the GObject itself. React fixes this on the 19.3 line.\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"]}
@@ -8,6 +8,7 @@ export { useObjectValue } from "./hooks/use-object-value.js";
8
8
  export type * from "./prop-types.js";
9
9
  export { isRootElement } from "./reconciler/root-element.js";
10
10
  export { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
11
+ export { applyWrite } from "./reconciler/signals.js";
11
12
  export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
12
13
  export { type RefProp, resolveRefProp } from "./utils/ref-prop.js";
13
14
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
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"}
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,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/internal.js CHANGED
@@ -7,6 +7,7 @@ export { useMergedRef } from "./hooks/use-merged-refs.js";
7
7
  export { useObjectValue } from "./hooks/use-object-value.js";
8
8
  export { isRootElement } from "./reconciler/root-element.js";
9
9
  export { createReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
10
+ export { applyWrite } from "./reconciler/signals.js";
10
11
  export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
11
12
  export { resolveRefProp } from "./utils/ref-prop.js";
12
13
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
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"]}
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,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,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 { applyWrite } from \"./reconciler/signals.js\";\nexport { getAccessibleMetadata } from \"./utils/accessible-metadata.js\";\nexport { type RefProp, resolveRefProp } from \"./utils/ref-prop.js\";\n"]}
@@ -1 +1 @@
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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C;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"}
@@ -3,7 +3,7 @@ import { drain, kebabCase } from "@gtkx/utils";
3
3
  import { applyAccessibleProps, isAccessibleProp } from "../utils/accessible-props.js";
4
4
  import { typeInfoFor } from "./metadata.js";
5
5
  import { getOrCreateContext } from "./node.js";
6
- import { connectHandler, disconnectHandler } from "./signals.js";
6
+ import { applyWrite, connectHandler, disconnectHandler } from "./signals.js";
7
7
  import { bufferText, hasSameText, isContentPaintableProp, markTextDirty, TEXT_PROP } from "./text.js";
8
8
  const REACT_RESERVED_PROPS = new Set(["children", "ref", "key"]);
9
9
  const NOTIFY_PREFIX = "onNotify";
@@ -25,7 +25,9 @@ const writeValue = (object, name, value) => {
25
25
  if (hasSameText(object, name, value)) {
26
26
  return;
27
27
  }
28
- Reflect.set(object, name, value);
28
+ applyWrite(() => {
29
+ Reflect.set(object, name, value);
30
+ });
29
31
  };
30
32
  const resetPlain = (object, info, name) => {
31
33
  if (Object.hasOwn(info.defaults, name)) {
@@ -44,9 +46,11 @@ const applyBufferText = (buffer, text) => {
44
46
  if (bufferText(buffer) === text) {
45
47
  return;
46
48
  }
47
- buffer.beginIrreversibleAction();
48
- buffer.setText(text, -1);
49
- buffer.endIrreversibleAction();
49
+ applyWrite(() => {
50
+ buffer.beginIrreversibleAction();
51
+ buffer.setText(text, -1);
52
+ buffer.endIrreversibleAction();
53
+ });
50
54
  };
51
55
  const isBufferText = (node, name) => name === TEXT_PROP && node.contentKind === "buffer" && node.object instanceof Gtk.TextBuffer;
52
56
  const propText = (value) => (typeof value === "string" ? value : JSON.stringify(value));
@@ -117,7 +121,9 @@ const restoreActionableSensitivity = (node, info, prev, next) => {
117
121
  }
118
122
  const desired = "sensitive" in next ? next.sensitive : info.defaults.sensitive;
119
123
  if (typeof desired === "boolean") {
120
- Reflect.set(node.object, "sensitive", desired);
124
+ applyWrite(() => {
125
+ Reflect.set(node.object, "sensitive", desired);
126
+ });
121
127
  }
122
128
  };
123
129
  const applyHandlers = (target, info, prev, next) => {