@burger-editor/client 4.0.0-alpha.75 → 4.0.0-alpha.76
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/client.js +178 -160
- package/dist/client.js.map +1 -1
- package/dist/{editable-area-view-DssYcTqQ.js → editable-area-view-S2Uz7pl8.js} +2 -2
- package/dist/{editable-area-view-DssYcTqQ.js.map → editable-area-view-S2Uz7pl8.js.map} +1 -1
- package/dist/{engine-context-gX6mWHke.js → engine-context-D0zt6fhJ.js} +48 -1
- package/dist/engine-context-D0zt6fhJ.js.map +1 -0
- package/dist/file-browser/store.d.ts +5 -0
- package/dist/file-browser/store.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/ui.js +12 -2
- package/dist/ui.js.map +1 -1
- package/package.json +6 -6
- package/dist/engine-context-gX6mWHke.js.map +0 -1
|
@@ -3922,6 +3922,51 @@ function stringifyField(fieldName, propName) {
|
|
|
3922
3922
|
//#endregion
|
|
3923
3923
|
//#region ../frozen-patty/dist/set-component.js
|
|
3924
3924
|
/**
|
|
3925
|
+
* `picture` 内の `source` で無効な、`img` 専用の属性。
|
|
3926
|
+
* `source` で有効な属性の allowlist にしないのは、グローバル属性・`data-*`・
|
|
3927
|
+
* `aria-*` を列挙しきれず、取りこぼすと正しい属性まで落としてしまうため
|
|
3928
|
+
*/
|
|
3929
|
+
var PICTURE_SOURCE_INVALID_ATTRS = [
|
|
3930
|
+
"alt",
|
|
3931
|
+
"src",
|
|
3932
|
+
"loading",
|
|
3933
|
+
"decoding",
|
|
3934
|
+
"fetchpriority",
|
|
3935
|
+
"crossorigin",
|
|
3936
|
+
"referrerpolicy",
|
|
3937
|
+
"usemap",
|
|
3938
|
+
"ismap",
|
|
3939
|
+
"elementtiming",
|
|
3940
|
+
"attributionsrc",
|
|
3941
|
+
"align",
|
|
3942
|
+
"border",
|
|
3943
|
+
"hspace",
|
|
3944
|
+
"vspace",
|
|
3945
|
+
"longdesc",
|
|
3946
|
+
"name",
|
|
3947
|
+
"lowsrc"
|
|
3948
|
+
];
|
|
3949
|
+
/**
|
|
3950
|
+
* `picture` 内の `img` で無効な、`source` 専用の属性
|
|
3951
|
+
*/
|
|
3952
|
+
var PICTURE_IMG_INVALID_ATTRS = ["media", "type"];
|
|
3953
|
+
/**
|
|
3954
|
+
* 要素から指定した属性を取り除く
|
|
3955
|
+
*
|
|
3956
|
+
* replaceNode は未バインドの静的属性を要素の種類に関係なく引き継ぎ、
|
|
3957
|
+
* 変換元と変換先の要素が同じ場合は何もしない。そのため、雛形 img の静的な
|
|
3958
|
+
* alt が source に付いたり、過去の出力で img に付いた media が残ったりする。
|
|
3959
|
+
* 変換の有無にかかわらず、ここで必ず落とす。
|
|
3960
|
+
* バインドされたフィールドは落とさない。要素のプロパティに無い属性は
|
|
3961
|
+
* setValue が書き込まないため(propInElement)、データの index 対応を
|
|
3962
|
+
* 崩してまで data-* 宣言から外す必要がない
|
|
3963
|
+
* @param el
|
|
3964
|
+
* @param names
|
|
3965
|
+
*/
|
|
3966
|
+
function removeAttrs(el, names) {
|
|
3967
|
+
for (const name of names) el.removeAttribute(name);
|
|
3968
|
+
}
|
|
3969
|
+
/**
|
|
3925
3970
|
*
|
|
3926
3971
|
* @param el
|
|
3927
3972
|
* @param data
|
|
@@ -3956,12 +4001,14 @@ function setComponent(el, data, attr, filter, xssSanitize = true) {
|
|
|
3956
4001
|
let fields = getFields(item, attr);
|
|
3957
4002
|
if (i === 0) {
|
|
3958
4003
|
item = replaceNode(item, "img", attr, xssSanitize);
|
|
4004
|
+
removeAttrs(item, PICTURE_IMG_INVALID_ATTRS);
|
|
3959
4005
|
fields = replaceProp(fields, "srcset", "src");
|
|
3960
4006
|
fields = removeProp(fields, "sizes");
|
|
3961
4007
|
const fieldQuery = stringifyFields(fields);
|
|
3962
4008
|
item.setAttribute(`data-${attr}`, fieldQuery);
|
|
3963
4009
|
} else {
|
|
3964
4010
|
item = replaceNode(item, "source", attr, xssSanitize);
|
|
4011
|
+
removeAttrs(item, PICTURE_SOURCE_INVALID_ATTRS);
|
|
3965
4012
|
fields = replaceProp(fields, "src", "srcset");
|
|
3966
4013
|
fields = removeProp(fields, "alt");
|
|
3967
4014
|
fields = removeProp(fields, "loading");
|
|
@@ -15755,4 +15802,4 @@ function useEngine() {
|
|
|
15755
15802
|
//#endregion
|
|
15756
15803
|
export { UIStateStore as a, CommandBus as c, formatDate as d, CSS_LAYER as f, BurgerEditorEngine as i, Item as l, useEngine as n, createBgeEvent as o, getBlockAtPosition as r, beginProcessing as s, EngineProvider as t, formatByteSize as u };
|
|
15757
15804
|
|
|
15758
|
-
//# sourceMappingURL=engine-context-
|
|
15805
|
+
//# sourceMappingURL=engine-context-D0zt6fhJ.js.map
|