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