@salesforce/ui-design-mode 10.9.1 → 10.10.0
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/authoring/core/DesignPropertyPanelRoot.d.cts +31 -1
- package/dist/authoring/core/DesignPropertyPanelRoot.d.ts +31 -1
- package/dist/authoring/core/DesignPropertyPanelRoot.d.ts.map +1 -1
- package/dist/authoring/core/editors/ImageEditor.d.cts +110 -0
- package/dist/authoring/core/editors/ImageEditor.d.ts +110 -0
- package/dist/authoring/core/editors/ImageEditor.d.ts.map +1 -0
- package/dist/authoring/core/history/historyService.d.cts +3 -1
- package/dist/authoring/core/history/historyService.d.ts +3 -1
- package/dist/authoring/core/history/historyService.d.ts.map +1 -1
- package/dist/authoring/core/history/iframeCommandExecutor.d.cts +1 -1
- package/dist/authoring/core/history/iframeCommandExecutor.d.ts +1 -1
- package/dist/authoring/core/history/iframeCommandExecutor.d.ts.map +1 -1
- package/dist/authoring/core/labels/labels.d.cts +106 -0
- package/dist/authoring/core/labels/labels.d.ts +106 -0
- package/dist/authoring/core/labels/labels.d.ts.map +1 -1
- package/dist/authoring/host/index.cjs +111 -0
- package/dist/authoring/host/index.d.cts +86 -0
- package/dist/authoring/host/index.d.ts +86 -0
- package/dist/authoring/host/index.d.ts.map +1 -0
- package/dist/authoring/host/index.js +111 -0
- package/dist/authoring/react/index.d.cts +2 -1
- package/dist/authoring/react/index.d.ts +2 -1
- package/dist/authoring/react/index.d.ts.map +1 -1
- package/dist/authoring/react/index.js +4 -4
- package/dist/authoring/react/styles.css +1 -1
- package/dist/authoring/web-component/index.d.cts +8 -1
- package/dist/authoring/web-component/index.d.ts +8 -1
- package/dist/authoring/web-component/index.d.ts.map +1 -1
- package/dist/authoring/web-component/index.js +430 -21
- package/dist/protocol/messageTypes.d.cts +13 -1
- package/dist/protocol/messageTypes.d.ts +13 -1
- package/dist/protocol/messageTypes.d.ts.map +1 -1
- package/dist/runtime/design-mode-interactions.js +4 -0
- package/dist/runtime/interactions/interactionsController.d.ts.map +1 -1
- package/package.json +12 -1
|
@@ -44,7 +44,19 @@ export interface TextChangeMessage {
|
|
|
44
44
|
text: string;
|
|
45
45
|
sourceLocation?: SourceLocation;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Apply a media-element change (e.g. `<img src>`, `<video src>`).
|
|
49
|
+
*
|
|
50
|
+
* `attributes` is a sparse map: only the keys the panel intends to change are
|
|
51
|
+
* present, and `undefined` means "leave untouched". The map is intentionally a
|
|
52
|
+
* loose `Record` so the contract stays additive across future media tags — it
|
|
53
|
+
* is NOT a license to set arbitrary DOM attributes. The iframe runtime applies
|
|
54
|
+
* it through a per-tag whitelist (see `mediaAppliers` in
|
|
55
|
+
* interactionsController.ts): each tag's applier reads only the attribute keys
|
|
56
|
+
* valid for that tag (for `img`: `src`/`alt`/`width`/`height`) and ignores any
|
|
57
|
+
* others, so an unexpected key never reaches the element. Keep that whitelist
|
|
58
|
+
* authoritative — do not switch the apply path to spreading this map.
|
|
59
|
+
*/
|
|
48
60
|
export interface MediaChangeMessage {
|
|
49
61
|
type: "media-change";
|
|
50
62
|
tag: string;
|
|
@@ -44,7 +44,19 @@ export interface TextChangeMessage {
|
|
|
44
44
|
text: string;
|
|
45
45
|
sourceLocation?: SourceLocation;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Apply a media-element change (e.g. `<img src>`, `<video src>`).
|
|
49
|
+
*
|
|
50
|
+
* `attributes` is a sparse map: only the keys the panel intends to change are
|
|
51
|
+
* present, and `undefined` means "leave untouched". The map is intentionally a
|
|
52
|
+
* loose `Record` so the contract stays additive across future media tags — it
|
|
53
|
+
* is NOT a license to set arbitrary DOM attributes. The iframe runtime applies
|
|
54
|
+
* it through a per-tag whitelist (see `mediaAppliers` in
|
|
55
|
+
* interactionsController.ts): each tag's applier reads only the attribute keys
|
|
56
|
+
* valid for that tag (for `img`: `src`/`alt`/`width`/`height`) and ignores any
|
|
57
|
+
* others, so an unexpected key never reaches the element. Keep that whitelist
|
|
58
|
+
* authoritative — do not switch the apply path to spreading this map.
|
|
59
|
+
*/
|
|
48
60
|
export interface MediaChangeMessage {
|
|
49
61
|
type: "media-change";
|
|
50
62
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageTypes.d.ts","sourceRoot":"","sources":["../../src/protocol/messageTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB;AAID,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,qBAAqB,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IAC1C,IAAI,EAAE,sBAAsB,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC;AAED
|
|
1
|
+
{"version":3,"file":"messageTypes.d.ts","sourceRoot":"","sources":["../../src/protocol/messageTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB;AAID,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,qBAAqB,CAAC;CAC5B;AAED,MAA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IAC9B,GAAG,EAAE,KAAK,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC;AAEvC,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,eAAO,MAAM,uBAAuB,EAAG,qBAA8B,CAAC;AACtE,eAAO,MAAM,wBAAwB,EAAG,sBAA+B,CAAC;AACxE,eAAO,MAAM,gBAAgB,EAAG,cAAuB,CAAC;AACxD,eAAO,MAAM,eAAe,EAAG,aAAsB,CAAC;AACtD,eAAO,MAAM,gBAAgB,EAAG,cAAuB,CAAC;AACxD,eAAO,MAAM,4BAA4B,EAAG,0BAAmC,CAAC;AAChF,eAAO,MAAM,sBAAsB,EAAG,oBAA6B,CAAC;AACpE,eAAO,MAAM,gBAAgB,EAAG,cAAuB,CAAC"}
|
|
@@ -642,6 +642,10 @@
|
|
|
642
642
|
|
|
643
643
|
// src/runtime/interactions/interactionsController.ts
|
|
644
644
|
var mediaAppliers = {
|
|
645
|
+
// Whitelist by construction: this applier reads only the attribute keys
|
|
646
|
+
// valid for <img> and ignores anything else in `attrs`. The map is never
|
|
647
|
+
// spread onto the element, so a host→iframe payload cannot set arbitrary
|
|
648
|
+
// attributes (see MediaChangeMessage in protocol/messageTypes.ts).
|
|
645
649
|
img: (el, attrs) => {
|
|
646
650
|
const img = el;
|
|
647
651
|
if (attrs.src !== void 0) img.setAttribute("src", attrs.src);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionsController.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/interactionsController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"interactionsController.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/interactionsController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,qBAAqB,CAAC;AAuC7B,qBAAa,sBAAsB;IAClC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,OAAO,UAAO;IAwD1B;;OAEG;IACH,UAAU,IAAI,IAAI;IAiBlB;;OAEG;IACH,MAAM,IAAI,IAAI;IAKd;;OAEG;IACH,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,cAAc;IAWtB;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAMxF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAMpE;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC9C,cAAc,CAAC,EAAE,cAAc,GAC7B,IAAI;IAUP;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-design-mode",
|
|
3
3
|
"description": "Hybrid editor (design-mode) authoring UI, iframe runtime, source-locator, and protocol for Salesforce UI Bundles",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.10.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -35,6 +35,16 @@
|
|
|
35
35
|
"default": "./dist/runtime/index.cjs"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
"./authoring/host": {
|
|
39
|
+
"import": {
|
|
40
|
+
"types": "./dist/authoring/host/index.d.ts",
|
|
41
|
+
"default": "./dist/authoring/host/index.js"
|
|
42
|
+
},
|
|
43
|
+
"require": {
|
|
44
|
+
"types": "./dist/authoring/host/index.d.cts",
|
|
45
|
+
"default": "./dist/authoring/host/index.cjs"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
38
48
|
"./authoring/react": {
|
|
39
49
|
"types": "./dist/authoring/react/index.d.ts",
|
|
40
50
|
"import": "./dist/authoring/react/index.js"
|
|
@@ -80,6 +90,7 @@
|
|
|
80
90
|
"@types/react": "19.2.14",
|
|
81
91
|
"@types/react-dom": "19.2.3",
|
|
82
92
|
"esbuild": "^0.24.0",
|
|
93
|
+
"jsdom": "^27.0.0",
|
|
83
94
|
"react": "^19.2.0",
|
|
84
95
|
"react-dom": "^19.2.0",
|
|
85
96
|
"ts-morph": "^25.0.0",
|