@byteluck-fe/model-driven-engine 2.22.1-beta.2 → 2.23.0-beta.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.
@@ -2,7 +2,7 @@
2
2
  * @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
3
3
  * @Date: 2022-04-15 14:06:03
4
4
  * @LastEditors: SuperLuckyqi
5
- * @LastEditTime: 2024-07-23 15:19:34
5
+ * @LastEditTime: 2024-07-24 11:38:32
6
6
  * @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
7
7
  */ function _class_call_check(instance, Constructor) {
8
8
  if (!(instance instanceof Constructor)) {
@@ -58,15 +58,14 @@ export var StylePlugin = /*#__PURE__*/ function() {
58
58
  var style = document.createElement('style');
59
59
  style.className = 'edit-css-' + engine.id;
60
60
  var dom = document.querySelector('head');
61
- dom.appendChild(style);
62
- var styleSheet = style.sheet;
63
- var rule;
61
+ dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
62
+ var cssStyleText;
64
63
  if (this.isPc) {
65
- rule = "[data-engine-id='".concat(engine.id, "']{ ").concat(compiledStyle, " }");
64
+ cssStyleText = "[data-engine-id='".concat(engine.id, "']{ ").concat(compiledStyle, " }");
66
65
  } else {
67
- rule = compiledStyle;
66
+ cssStyleText = compiledStyle;
68
67
  }
69
- styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.insertRule(rule, styleSheet.cssRules.length);
68
+ style.appendChild(document.createTextNode(cssStyleText));
70
69
  }
71
70
  }
72
71
  ]);