@contractspec/lib.surface-runtime 0.2.3 → 0.3.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.
Files changed (153) hide show
  1. package/dist/adapters/ai-sdk-stub.js +1 -6
  2. package/dist/adapters/blocknote-stub.js +3 -8
  3. package/dist/adapters/dnd-kit-adapter.js +6 -11
  4. package/dist/adapters/dnd-kit-stub.js +1 -6
  5. package/dist/adapters/floating-ui-stub.js +4 -9
  6. package/dist/adapters/index.js +7 -176
  7. package/dist/adapters/interfaces.js +0 -1
  8. package/dist/adapters/motion-stub.js +2 -7
  9. package/dist/adapters/resizable-panels-stub.js +7 -12
  10. package/dist/browser/adapters/ai-sdk-stub.js +1 -5
  11. package/dist/browser/adapters/blocknote-stub.js +3 -7
  12. package/dist/browser/adapters/dnd-kit-adapter.js +6 -10
  13. package/dist/browser/adapters/dnd-kit-stub.js +1 -5
  14. package/dist/browser/adapters/floating-ui-stub.js +4 -8
  15. package/dist/browser/adapters/index.js +7 -175
  16. package/dist/browser/adapters/motion-stub.js +2 -6
  17. package/dist/browser/adapters/resizable-panels-stub.js +5 -9
  18. package/dist/browser/evals/golden-harness.js +4 -825
  19. package/dist/browser/examples/pm-workbench.bundle.js +2 -316
  20. package/dist/browser/i18n/catalogs/en.js +1 -5
  21. package/dist/browser/i18n/catalogs/es.js +1 -5
  22. package/dist/browser/i18n/catalogs/fr.js +1 -5
  23. package/dist/browser/i18n/catalogs/index.js +3 -133
  24. package/dist/browser/i18n/index.js +3 -168
  25. package/dist/browser/i18n/keys.js +1 -5
  26. package/dist/browser/i18n/messages.js +6 -137
  27. package/dist/browser/index.js +4 -2466
  28. package/dist/browser/react/BundleProvider.js +12 -19
  29. package/dist/browser/react/BundleRenderer.js +19 -662
  30. package/dist/browser/react/OverlayConflictResolver.js +12 -180
  31. package/dist/browser/react/PatchProposalCard.js +9 -177
  32. package/dist/browser/react/RegionRenderer.js +14 -60
  33. package/dist/browser/react/SlotRenderer.js +15 -58
  34. package/dist/browser/react/WidgetPalette.js +6 -10
  35. package/dist/browser/react/index.js +14 -790
  36. package/dist/browser/runtime/apply-surface-patch.js +3 -208
  37. package/dist/browser/runtime/audit-events.js +8 -19
  38. package/dist/browser/runtime/build-context.js +2 -6
  39. package/dist/browser/runtime/extension-registry.js +3 -9
  40. package/dist/browser/runtime/field-renderer-registry.js +5 -11
  41. package/dist/browser/runtime/index.js +54 -1487
  42. package/dist/browser/runtime/overlay-alignment.js +8 -19
  43. package/dist/browser/runtime/overlay-signer.js +2 -7
  44. package/dist/browser/runtime/override-store.js +3 -9
  45. package/dist/browser/runtime/planner-prompt.js +2 -6
  46. package/dist/browser/runtime/planner-tools.js +3 -9
  47. package/dist/browser/runtime/policy-eval.js +3 -135
  48. package/dist/browser/runtime/preference-adapter.js +2 -62
  49. package/dist/browser/runtime/resolve-bundle.js +10 -447
  50. package/dist/browser/runtime/resolve-preferences.js +3 -7
  51. package/dist/browser/runtime/rollback.js +2 -325
  52. package/dist/browser/runtime/widget-registry.js +1 -5
  53. package/dist/browser/spec/define-module-bundle.js +2 -67
  54. package/dist/browser/spec/index.js +9 -317
  55. package/dist/browser/spec/validate-bundle.js +3 -8
  56. package/dist/browser/spec/validate-surface-patch.js +5 -11
  57. package/dist/browser/telemetry/index.js +4 -16
  58. package/dist/browser/telemetry/surface-metrics.js +7 -16
  59. package/dist/evals/golden-context.js +0 -1
  60. package/dist/evals/golden-harness.js +4 -826
  61. package/dist/examples/pm-workbench.bundle.js +2 -317
  62. package/dist/i18n/catalogs/en.js +1 -6
  63. package/dist/i18n/catalogs/es.js +1 -6
  64. package/dist/i18n/catalogs/fr.js +1 -6
  65. package/dist/i18n/catalogs/index.js +3 -134
  66. package/dist/i18n/index.js +3 -169
  67. package/dist/i18n/keys.js +1 -6
  68. package/dist/i18n/messages.js +6 -138
  69. package/dist/index.js +4 -2467
  70. package/dist/node/adapters/ai-sdk-stub.js +1 -5
  71. package/dist/node/adapters/blocknote-stub.js +3 -7
  72. package/dist/node/adapters/dnd-kit-adapter.js +6 -10
  73. package/dist/node/adapters/dnd-kit-stub.js +1 -5
  74. package/dist/node/adapters/floating-ui-stub.js +4 -8
  75. package/dist/node/adapters/index.js +7 -175
  76. package/dist/node/adapters/motion-stub.js +2 -6
  77. package/dist/node/adapters/resizable-panels-stub.js +5 -9
  78. package/dist/node/evals/golden-harness.js +4 -825
  79. package/dist/node/examples/pm-workbench.bundle.js +2 -316
  80. package/dist/node/i18n/catalogs/en.js +1 -5
  81. package/dist/node/i18n/catalogs/es.js +1 -5
  82. package/dist/node/i18n/catalogs/fr.js +1 -5
  83. package/dist/node/i18n/catalogs/index.js +3 -133
  84. package/dist/node/i18n/index.js +3 -168
  85. package/dist/node/i18n/keys.js +1 -5
  86. package/dist/node/i18n/messages.js +6 -137
  87. package/dist/node/index.js +4 -2466
  88. package/dist/node/react/BundleProvider.js +12 -19
  89. package/dist/node/react/BundleRenderer.js +19 -662
  90. package/dist/node/react/OverlayConflictResolver.js +12 -180
  91. package/dist/node/react/PatchProposalCard.js +9 -177
  92. package/dist/node/react/RegionRenderer.js +14 -60
  93. package/dist/node/react/SlotRenderer.js +15 -58
  94. package/dist/node/react/WidgetPalette.js +6 -10
  95. package/dist/node/react/index.js +14 -790
  96. package/dist/node/runtime/apply-surface-patch.js +3 -208
  97. package/dist/node/runtime/audit-events.js +8 -19
  98. package/dist/node/runtime/build-context.js +2 -6
  99. package/dist/node/runtime/extension-registry.js +3 -9
  100. package/dist/node/runtime/field-renderer-registry.js +5 -11
  101. package/dist/node/runtime/index.js +54 -1487
  102. package/dist/node/runtime/overlay-alignment.js +8 -19
  103. package/dist/node/runtime/overlay-signer.js +2 -7
  104. package/dist/node/runtime/override-store.js +3 -9
  105. package/dist/node/runtime/planner-prompt.js +2 -6
  106. package/dist/node/runtime/planner-tools.js +3 -9
  107. package/dist/node/runtime/policy-eval.js +3 -135
  108. package/dist/node/runtime/preference-adapter.js +2 -62
  109. package/dist/node/runtime/resolve-bundle.js +10 -447
  110. package/dist/node/runtime/resolve-preferences.js +3 -7
  111. package/dist/node/runtime/rollback.js +2 -325
  112. package/dist/node/runtime/widget-registry.js +1 -5
  113. package/dist/node/spec/define-module-bundle.js +2 -67
  114. package/dist/node/spec/index.js +9 -317
  115. package/dist/node/spec/validate-bundle.js +3 -8
  116. package/dist/node/spec/validate-surface-patch.js +5 -11
  117. package/dist/node/telemetry/index.js +4 -16
  118. package/dist/node/telemetry/surface-metrics.js +7 -16
  119. package/dist/react/BundleProvider.js +12 -20
  120. package/dist/react/BundleRenderer.d.ts +3 -1
  121. package/dist/react/BundleRenderer.js +19 -663
  122. package/dist/react/OverlayConflictResolver.js +12 -181
  123. package/dist/react/PatchProposalCard.js +9 -178
  124. package/dist/react/RegionRenderer.js +14 -61
  125. package/dist/react/SlotRenderer.js +15 -59
  126. package/dist/react/WidgetPalette.js +6 -11
  127. package/dist/react/index.js +14 -791
  128. package/dist/runtime/apply-surface-patch.js +3 -209
  129. package/dist/runtime/audit-events.js +8 -20
  130. package/dist/runtime/build-context.js +2 -7
  131. package/dist/runtime/extension-registry.js +3 -10
  132. package/dist/runtime/field-renderer-registry.js +9 -16
  133. package/dist/runtime/index.js +54 -1488
  134. package/dist/runtime/overlay-alignment.js +8 -20
  135. package/dist/runtime/overlay-signer.js +2 -8
  136. package/dist/runtime/override-store.js +3 -10
  137. package/dist/runtime/planner-prompt.js +11 -9
  138. package/dist/runtime/planner-tools.js +4 -11
  139. package/dist/runtime/policy-eval.js +3 -136
  140. package/dist/runtime/preference-adapter.js +2 -63
  141. package/dist/runtime/resolve-bundle.js +10 -448
  142. package/dist/runtime/resolve-preferences.js +3 -8
  143. package/dist/runtime/rollback.js +2 -326
  144. package/dist/runtime/widget-registry.js +1 -6
  145. package/dist/spec/define-module-bundle.js +2 -68
  146. package/dist/spec/index.js +9 -318
  147. package/dist/spec/types.js +0 -1
  148. package/dist/spec/validate-bundle.js +3 -9
  149. package/dist/spec/validate-surface-patch.js +5 -12
  150. package/dist/spec/verification-snapshot-types.js +0 -1
  151. package/dist/telemetry/index.js +4 -17
  152. package/dist/telemetry/surface-metrics.js +7 -17
  153. package/package.json +7 -7
@@ -1,179 +1,14 @@
1
- // src/i18n/catalogs/en.ts
2
- import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
3
- var enMessages = defineTranslation({
4
- meta: {
5
- key: "surface-runtime.messages",
6
- version: "1.0.0",
7
- domain: "surface-runtime",
8
- description: "User-facing strings for surface-runtime UI components",
9
- owners: ["platform"],
10
- stability: "experimental"
11
- },
12
- locale: "en",
13
- fallback: "en",
14
- messages: {
15
- "overlay.conflicts.title": {
16
- value: "Overlay conflicts",
17
- description: "Title for overlay conflict resolution banner"
18
- },
19
- "overlay.conflicts.keepScope": {
20
- value: "Keep {scope}",
21
- description: "Button to keep overlay from scope A or B"
22
- },
23
- "patch.accept": {
24
- value: "Accept",
25
- description: "Accept patch proposal button"
26
- },
27
- "patch.reject": {
28
- value: "Reject",
29
- description: "Reject patch proposal button"
30
- },
31
- "patch.addWidget": {
32
- value: "Add {title} to {slot}",
33
- description: "Insert node proposal summary"
34
- },
35
- "patch.removeItem": {
36
- value: "Remove item",
37
- description: "Remove node proposal summary"
38
- },
39
- "patch.switchLayout": {
40
- value: "Switch to {layoutId} layout",
41
- description: "Set layout proposal summary"
42
- },
43
- "patch.showField": {
44
- value: "Show field {fieldId}",
45
- description: "Reveal field proposal summary"
46
- },
47
- "patch.hideField": {
48
- value: "Hide field {fieldId}",
49
- description: "Hide field proposal summary"
50
- },
51
- "patch.moveTo": {
52
- value: "Move to {slot}",
53
- description: "Move node proposal summary"
54
- },
55
- "patch.replaceItem": {
56
- value: "Replace item",
57
- description: "Replace node proposal summary"
58
- },
59
- "patch.promote": {
60
- value: "Promote {actionId}",
61
- description: "Promote action proposal summary"
62
- },
63
- "patch.changes": {
64
- value: "{count} changes",
65
- description: "Multiple patch ops summary"
66
- }
67
- }
68
- });
69
-
70
- // src/i18n/catalogs/es.ts
71
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
72
- var esMessages = defineTranslation2({
73
- meta: {
74
- key: "surface-runtime.messages",
75
- version: "1.0.0",
76
- domain: "surface-runtime",
77
- description: "User-facing strings for surface-runtime UI components",
78
- owners: ["platform"],
79
- stability: "experimental"
80
- },
81
- locale: "es",
82
- fallback: "en",
83
- messages: {
84
- "overlay.conflicts.title": { value: "Conflictos de superposición" },
85
- "overlay.conflicts.keepScope": { value: "Mantener {scope}" },
86
- "patch.accept": { value: "Aceptar" },
87
- "patch.reject": { value: "Rechazar" },
88
- "patch.addWidget": { value: "Añadir {title} a {slot}" },
89
- "patch.removeItem": { value: "Eliminar elemento" },
90
- "patch.switchLayout": { value: "Cambiar a disposición {layoutId}" },
91
- "patch.showField": { value: "Mostrar campo {fieldId}" },
92
- "patch.hideField": { value: "Ocultar campo {fieldId}" },
93
- "patch.moveTo": { value: "Mover a {slot}" },
94
- "patch.replaceItem": { value: "Reemplazar elemento" },
95
- "patch.promote": { value: "Promover {actionId}" },
96
- "patch.changes": { value: "{count} cambios" }
97
- }
98
- });
99
-
100
- // src/i18n/catalogs/fr.ts
101
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
102
- var frMessages = defineTranslation3({
103
- meta: {
104
- key: "surface-runtime.messages",
105
- version: "1.0.0",
106
- domain: "surface-runtime",
107
- description: "User-facing strings for surface-runtime UI components",
108
- owners: ["platform"],
109
- stability: "experimental"
110
- },
111
- locale: "fr",
112
- fallback: "en",
113
- messages: {
114
- "overlay.conflicts.title": { value: "Conflits de superposition" },
115
- "overlay.conflicts.keepScope": { value: "Conserver {scope}" },
116
- "patch.accept": { value: "Accepter" },
117
- "patch.reject": { value: "Rejeter" },
118
- "patch.addWidget": { value: "Ajouter {title} à {slot}" },
119
- "patch.removeItem": { value: "Supprimer l'élément" },
120
- "patch.switchLayout": { value: "Passer à la disposition {layoutId}" },
121
- "patch.showField": { value: "Afficher le champ {fieldId}" },
122
- "patch.hideField": { value: "Masquer le champ {fieldId}" },
123
- "patch.moveTo": { value: "Déplacer vers {slot}" },
124
- "patch.replaceItem": { value: "Remplacer l'élément" },
125
- "patch.promote": { value: "Promouvoir {actionId}" },
126
- "patch.changes": { value: "{count} modifications" }
127
- }
128
- });
129
-
130
- // src/i18n/messages.ts
131
- import {
132
- createI18nFactory
133
- } from "@contractspec/lib.contracts-spec/translations";
134
- var factory = createI18nFactory({
135
- specKey: "surface-runtime.messages",
136
- catalogs: [enMessages, frMessages, esMessages]
137
- });
138
- var createSurfaceI18n = factory.create;
139
- var getDefaultSurfaceI18n = factory.getDefault;
140
-
141
- // src/i18n/keys.ts
142
- var SURFACE_KEYS = {
143
- "overlay.conflicts.title": "overlay.conflicts.title",
144
- "overlay.conflicts.keepScope": "overlay.conflicts.keepScope",
145
- "patch.accept": "patch.accept",
146
- "patch.reject": "patch.reject",
147
- "patch.addWidget": "patch.addWidget",
148
- "patch.removeItem": "patch.removeItem",
149
- "patch.switchLayout": "patch.switchLayout",
150
- "patch.showField": "patch.showField",
151
- "patch.hideField": "patch.hideField",
152
- "patch.moveTo": "patch.moveTo",
153
- "patch.replaceItem": "patch.replaceItem",
154
- "patch.promote": "patch.promote",
155
- "patch.changes": "patch.changes"
156
- };
157
-
158
- // src/i18n/index.ts
159
- import {
160
- resolveLocale,
161
- isSupportedLocale,
162
- DEFAULT_LOCALE,
163
- SUPPORTED_LOCALES
164
- } from "@contractspec/lib.contracts-spec/translations";
165
-
166
- // src/react/OverlayConflictResolver.tsx
167
- import { useMemo } from "react";
168
- import { jsxDEV } from "react/jsx-dev-runtime";
169
1
  "use client";
170
- function OverlayConflictResolver({
2
+ import { jsxDEV as jsxDEV_7x81h0kn } from "react/jsx-dev-runtime";
3
+ import { useMemo } from "react";
4
+ import { createSurfaceI18n } from "../i18n";
5
+ export function OverlayConflictResolver({
171
6
  conflicts,
172
7
  onResolve,
173
8
  locale
174
9
  }) {
175
10
  const i18n = useMemo(() => createSurfaceI18n(locale), [locale]);
176
- return /* @__PURE__ */ jsxDEV("div", {
11
+ return /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
177
12
  "data-overlay-conflicts": true,
178
13
  style: {
179
14
  padding: "12px",
@@ -183,7 +18,7 @@ function OverlayConflictResolver({
183
18
  backgroundColor: "var(--destructive/10, #fef2f2)"
184
19
  },
185
20
  children: [
186
- /* @__PURE__ */ jsxDEV("div", {
21
+ /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
187
22
  style: {
188
23
  fontSize: "14px",
189
24
  fontWeight: 600,
@@ -192,7 +27,7 @@ function OverlayConflictResolver({
192
27
  },
193
28
  children: i18n.t("overlay.conflicts.title")
194
29
  }, undefined, false, undefined, this),
195
- conflicts.map((c) => /* @__PURE__ */ jsxDEV("div", {
30
+ conflicts.map((c) => /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
196
31
  style: {
197
32
  padding: "8px",
198
33
  marginBottom: "8px",
@@ -201,10 +36,10 @@ function OverlayConflictResolver({
201
36
  fontSize: "13px"
202
37
  },
203
38
  children: [
204
- /* @__PURE__ */ jsxDEV("span", {
39
+ /* @__PURE__ */ jsxDEV_7x81h0kn("span", {
205
40
  children: c.targetKey
206
41
  }, undefined, false, undefined, this),
207
- /* @__PURE__ */ jsxDEV("span", {
42
+ /* @__PURE__ */ jsxDEV_7x81h0kn("span", {
208
43
  style: { margin: "0 8px", color: "#9ca3af" },
209
44
  children: [
210
45
  "(",
@@ -214,10 +49,10 @@ function OverlayConflictResolver({
214
49
  ")"
215
50
  ]
216
51
  }, undefined, true, undefined, this),
217
- /* @__PURE__ */ jsxDEV("div", {
52
+ /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
218
53
  style: { marginTop: "8px", display: "flex", gap: "8px" },
219
54
  children: [
220
- /* @__PURE__ */ jsxDEV("button", {
55
+ /* @__PURE__ */ jsxDEV_7x81h0kn("button", {
221
56
  type: "button",
222
57
  onClick: () => onResolve({ targetKey: c.targetKey, chosenScope: "A" }),
223
58
  style: {
@@ -230,7 +65,7 @@ function OverlayConflictResolver({
230
65
  },
231
66
  children: i18n.t("overlay.conflicts.keepScope", { scope: c.scopeA })
232
67
  }, undefined, false, undefined, this),
233
- /* @__PURE__ */ jsxDEV("button", {
68
+ /* @__PURE__ */ jsxDEV_7x81h0kn("button", {
234
69
  type: "button",
235
70
  onClick: () => onResolve({ targetKey: c.targetKey, chosenScope: "B" }),
236
71
  style: {
@@ -250,6 +85,3 @@ function OverlayConflictResolver({
250
85
  ]
251
86
  }, undefined, true, undefined, this);
252
87
  }
253
- export {
254
- OverlayConflictResolver
255
- };
@@ -1,173 +1,8 @@
1
- // src/i18n/catalogs/en.ts
2
- import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
3
- var enMessages = defineTranslation({
4
- meta: {
5
- key: "surface-runtime.messages",
6
- version: "1.0.0",
7
- domain: "surface-runtime",
8
- description: "User-facing strings for surface-runtime UI components",
9
- owners: ["platform"],
10
- stability: "experimental"
11
- },
12
- locale: "en",
13
- fallback: "en",
14
- messages: {
15
- "overlay.conflicts.title": {
16
- value: "Overlay conflicts",
17
- description: "Title for overlay conflict resolution banner"
18
- },
19
- "overlay.conflicts.keepScope": {
20
- value: "Keep {scope}",
21
- description: "Button to keep overlay from scope A or B"
22
- },
23
- "patch.accept": {
24
- value: "Accept",
25
- description: "Accept patch proposal button"
26
- },
27
- "patch.reject": {
28
- value: "Reject",
29
- description: "Reject patch proposal button"
30
- },
31
- "patch.addWidget": {
32
- value: "Add {title} to {slot}",
33
- description: "Insert node proposal summary"
34
- },
35
- "patch.removeItem": {
36
- value: "Remove item",
37
- description: "Remove node proposal summary"
38
- },
39
- "patch.switchLayout": {
40
- value: "Switch to {layoutId} layout",
41
- description: "Set layout proposal summary"
42
- },
43
- "patch.showField": {
44
- value: "Show field {fieldId}",
45
- description: "Reveal field proposal summary"
46
- },
47
- "patch.hideField": {
48
- value: "Hide field {fieldId}",
49
- description: "Hide field proposal summary"
50
- },
51
- "patch.moveTo": {
52
- value: "Move to {slot}",
53
- description: "Move node proposal summary"
54
- },
55
- "patch.replaceItem": {
56
- value: "Replace item",
57
- description: "Replace node proposal summary"
58
- },
59
- "patch.promote": {
60
- value: "Promote {actionId}",
61
- description: "Promote action proposal summary"
62
- },
63
- "patch.changes": {
64
- value: "{count} changes",
65
- description: "Multiple patch ops summary"
66
- }
67
- }
68
- });
69
-
70
- // src/i18n/catalogs/es.ts
71
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
72
- var esMessages = defineTranslation2({
73
- meta: {
74
- key: "surface-runtime.messages",
75
- version: "1.0.0",
76
- domain: "surface-runtime",
77
- description: "User-facing strings for surface-runtime UI components",
78
- owners: ["platform"],
79
- stability: "experimental"
80
- },
81
- locale: "es",
82
- fallback: "en",
83
- messages: {
84
- "overlay.conflicts.title": { value: "Conflictos de superposición" },
85
- "overlay.conflicts.keepScope": { value: "Mantener {scope}" },
86
- "patch.accept": { value: "Aceptar" },
87
- "patch.reject": { value: "Rechazar" },
88
- "patch.addWidget": { value: "Añadir {title} a {slot}" },
89
- "patch.removeItem": { value: "Eliminar elemento" },
90
- "patch.switchLayout": { value: "Cambiar a disposición {layoutId}" },
91
- "patch.showField": { value: "Mostrar campo {fieldId}" },
92
- "patch.hideField": { value: "Ocultar campo {fieldId}" },
93
- "patch.moveTo": { value: "Mover a {slot}" },
94
- "patch.replaceItem": { value: "Reemplazar elemento" },
95
- "patch.promote": { value: "Promover {actionId}" },
96
- "patch.changes": { value: "{count} cambios" }
97
- }
98
- });
99
-
100
- // src/i18n/catalogs/fr.ts
101
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
102
- var frMessages = defineTranslation3({
103
- meta: {
104
- key: "surface-runtime.messages",
105
- version: "1.0.0",
106
- domain: "surface-runtime",
107
- description: "User-facing strings for surface-runtime UI components",
108
- owners: ["platform"],
109
- stability: "experimental"
110
- },
111
- locale: "fr",
112
- fallback: "en",
113
- messages: {
114
- "overlay.conflicts.title": { value: "Conflits de superposition" },
115
- "overlay.conflicts.keepScope": { value: "Conserver {scope}" },
116
- "patch.accept": { value: "Accepter" },
117
- "patch.reject": { value: "Rejeter" },
118
- "patch.addWidget": { value: "Ajouter {title} à {slot}" },
119
- "patch.removeItem": { value: "Supprimer l'élément" },
120
- "patch.switchLayout": { value: "Passer à la disposition {layoutId}" },
121
- "patch.showField": { value: "Afficher le champ {fieldId}" },
122
- "patch.hideField": { value: "Masquer le champ {fieldId}" },
123
- "patch.moveTo": { value: "Déplacer vers {slot}" },
124
- "patch.replaceItem": { value: "Remplacer l'élément" },
125
- "patch.promote": { value: "Promouvoir {actionId}" },
126
- "patch.changes": { value: "{count} modifications" }
127
- }
128
- });
129
-
130
- // src/i18n/messages.ts
131
- import {
132
- createI18nFactory
133
- } from "@contractspec/lib.contracts-spec/translations";
134
- var factory = createI18nFactory({
135
- specKey: "surface-runtime.messages",
136
- catalogs: [enMessages, frMessages, esMessages]
137
- });
138
- var createSurfaceI18n = factory.create;
139
- var getDefaultSurfaceI18n = factory.getDefault;
140
-
141
- // src/i18n/keys.ts
142
- var SURFACE_KEYS = {
143
- "overlay.conflicts.title": "overlay.conflicts.title",
144
- "overlay.conflicts.keepScope": "overlay.conflicts.keepScope",
145
- "patch.accept": "patch.accept",
146
- "patch.reject": "patch.reject",
147
- "patch.addWidget": "patch.addWidget",
148
- "patch.removeItem": "patch.removeItem",
149
- "patch.switchLayout": "patch.switchLayout",
150
- "patch.showField": "patch.showField",
151
- "patch.hideField": "patch.hideField",
152
- "patch.moveTo": "patch.moveTo",
153
- "patch.replaceItem": "patch.replaceItem",
154
- "patch.promote": "patch.promote",
155
- "patch.changes": "patch.changes"
156
- };
157
-
158
- // src/i18n/index.ts
159
- import {
160
- resolveLocale,
161
- isSupportedLocale,
162
- DEFAULT_LOCALE,
163
- SUPPORTED_LOCALES
164
- } from "@contractspec/lib.contracts-spec/translations";
165
-
166
- // src/react/PatchProposalCard.tsx
167
- import { useMemo } from "react";
168
- import { jsxDEV } from "react/jsx-dev-runtime";
169
1
  "use client";
170
- function PatchProposalCard({
2
+ import { jsxDEV as jsxDEV_7x81h0kn } from "react/jsx-dev-runtime";
3
+ import { useMemo } from "react";
4
+ import { createSurfaceI18n } from "../i18n";
5
+ export function PatchProposalCard({
171
6
  proposal,
172
7
  onAccept,
173
8
  onReject,
@@ -176,7 +11,7 @@ function PatchProposalCard({
176
11
  const i18n = useMemo(() => createSurfaceI18n(locale), [locale]);
177
12
  const firstOp = proposal.ops[0];
178
13
  const summary = proposal.ops.length === 1 && firstOp ? describeOp(firstOp, i18n) : i18n.t("patch.changes", { count: proposal.ops.length });
179
- return /* @__PURE__ */ jsxDEV("div", {
14
+ return /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
180
15
  "data-proposal-id": proposal.proposalId,
181
16
  style: {
182
17
  padding: "12px",
@@ -186,14 +21,14 @@ function PatchProposalCard({
186
21
  backgroundColor: "var(--muted, #f9fafb)"
187
22
  },
188
23
  children: [
189
- /* @__PURE__ */ jsxDEV("div", {
24
+ /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
190
25
  style: { marginBottom: "8px", fontSize: "14px" },
191
26
  children: summary
192
27
  }, undefined, false, undefined, this),
193
- /* @__PURE__ */ jsxDEV("div", {
28
+ /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
194
29
  style: { display: "flex", gap: "8px" },
195
30
  children: [
196
- /* @__PURE__ */ jsxDEV("button", {
31
+ /* @__PURE__ */ jsxDEV_7x81h0kn("button", {
197
32
  type: "button",
198
33
  onClick: () => onAccept(proposal.proposalId),
199
34
  style: {
@@ -207,7 +42,7 @@ function PatchProposalCard({
207
42
  },
208
43
  children: i18n.t("patch.accept")
209
44
  }, undefined, false, undefined, this),
210
- /* @__PURE__ */ jsxDEV("button", {
45
+ /* @__PURE__ */ jsxDEV_7x81h0kn("button", {
211
46
  type: "button",
212
47
  onClick: () => onReject(proposal.proposalId),
213
48
  style: {
@@ -250,6 +85,3 @@ function describeOp(op, i18n) {
250
85
  return `${op.op}`;
251
86
  }
252
87
  }
253
- export {
254
- PatchProposalCard
255
- };
@@ -1,54 +1,11 @@
1
- // src/adapters/resizable-panels-stub.tsx
2
- import { jsxDEV } from "react/jsx-dev-runtime";
3
- var LAYOUT_STORAGE_KEY = "surface-runtime:panel-layout:";
4
- var resizablePanelsAdapterStub = {
5
- renderPanelGroup(region, ctx, renderChild) {
6
- const direction = region.direction === "horizontal" ? "row" : "column";
7
- return /* @__PURE__ */ jsxDEV("div", {
8
- "data-panel-group": true,
9
- "data-persist-key": region.persistKey,
10
- style: {
11
- display: "flex",
12
- flexDirection: direction,
13
- flex: 1,
14
- minHeight: 0
15
- },
16
- children: region.children.map((child, i) => /* @__PURE__ */ jsxDEV("div", {
17
- style: { flex: 1, minWidth: 0, minHeight: 0 },
18
- children: renderChild(child, ctx)
19
- }, i, false, undefined, this))
20
- }, undefined, false, undefined, this);
21
- },
22
- async restoreLayout(persistKey) {
23
- if (typeof localStorage === "undefined")
24
- return null;
25
- try {
26
- const raw = localStorage.getItem(LAYOUT_STORAGE_KEY + persistKey);
27
- if (!raw)
28
- return null;
29
- const parsed = JSON.parse(raw);
30
- return Array.isArray(parsed) ? parsed : null;
31
- } catch {
32
- return null;
33
- }
34
- },
35
- async saveLayout(persistKey, sizes) {
36
- if (typeof localStorage === "undefined")
37
- return;
38
- try {
39
- localStorage.setItem(LAYOUT_STORAGE_KEY + persistKey, JSON.stringify(sizes));
40
- } catch {}
41
- }
42
- };
43
-
44
- // src/react/RegionRenderer.tsx
45
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
46
- function RegionRenderer({
1
+ import { jsxDEV as jsxDEV_7x81h0kn } from "react/jsx-dev-runtime";
2
+ import { resizablePanelsAdapterStub } from "../adapters/resizable-panels-stub";
3
+ export function RegionRenderer({
47
4
  region,
48
5
  ctx,
49
6
  renderSlot
50
7
  }) {
51
- const renderChild = (child, childCtx) => /* @__PURE__ */ jsxDEV2(RegionRenderer, {
8
+ const renderChild = (child, childCtx) => /* @__PURE__ */ jsxDEV_7x81h0kn(RegionRenderer, {
52
9
  region: child,
53
10
  ctx: childCtx,
54
11
  renderSlot
@@ -66,7 +23,7 @@ function RegionRenderer({
66
23
  lg: 24
67
24
  };
68
25
  const gap = gapMap[region.gap ?? "md"];
69
- return /* @__PURE__ */ jsxDEV2("div", {
26
+ return /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
70
27
  "data-region": "stack",
71
28
  style: {
72
29
  display: "flex",
@@ -75,9 +32,9 @@ function RegionRenderer({
75
32
  flex: 1,
76
33
  minHeight: 0
77
34
  },
78
- children: region.children.map((child, i) => /* @__PURE__ */ jsxDEV2("div", {
35
+ children: region.children.map((child, i) => /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
79
36
  style: { flex: 1, minWidth: 0, minHeight: 0 },
80
- children: /* @__PURE__ */ jsxDEV2(RegionRenderer, {
37
+ children: /* @__PURE__ */ jsxDEV_7x81h0kn(RegionRenderer, {
81
38
  region: child,
82
39
  ctx,
83
40
  renderSlot
@@ -86,18 +43,18 @@ function RegionRenderer({
86
43
  }, undefined, false, undefined, this);
87
44
  }
88
45
  case "tabs":
89
- return /* @__PURE__ */ jsxDEV2("div", {
46
+ return /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
90
47
  "data-region": "tabs",
91
48
  children: [
92
- /* @__PURE__ */ jsxDEV2("div", {
49
+ /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
93
50
  role: "tablist",
94
- children: region.tabs.map((t) => /* @__PURE__ */ jsxDEV2("button", {
51
+ children: region.tabs.map((t) => /* @__PURE__ */ jsxDEV_7x81h0kn("button", {
95
52
  type: "button",
96
53
  role: "tab",
97
54
  children: t.title
98
55
  }, t.key, false, undefined, this))
99
56
  }, undefined, false, undefined, this),
100
- region.tabs[0] && /* @__PURE__ */ jsxDEV2(RegionRenderer, {
57
+ region.tabs[0] && /* @__PURE__ */ jsxDEV_7x81h0kn(RegionRenderer, {
101
58
  region: region.tabs[0].child,
102
59
  ctx,
103
60
  renderSlot
@@ -105,15 +62,15 @@ function RegionRenderer({
105
62
  ]
106
63
  }, undefined, true, undefined, this);
107
64
  case "slot":
108
- return /* @__PURE__ */ jsxDEV2("div", {
65
+ return /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
109
66
  "data-slot": region.slotId,
110
67
  children: renderSlot(region.slotId, ctx)
111
68
  }, undefined, false, undefined, this);
112
69
  case "floating":
113
- return /* @__PURE__ */ jsxDEV2("div", {
70
+ return /* @__PURE__ */ jsxDEV_7x81h0kn("div", {
114
71
  "data-floating": true,
115
72
  "data-anchor": region.anchorSlotId,
116
- children: /* @__PURE__ */ jsxDEV2(RegionRenderer, {
73
+ children: /* @__PURE__ */ jsxDEV_7x81h0kn(RegionRenderer, {
117
74
  region: region.child,
118
75
  ctx,
119
76
  renderSlot
@@ -123,6 +80,3 @@ function RegionRenderer({
123
80
  return null;
124
81
  }
125
82
  }
126
- export {
127
- RegionRenderer
128
- };