@xuda.io/runtime-bundle 1.0.1441 → 1.0.1443
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.
|
@@ -13963,24 +13963,20 @@ func.runtime.ui.init_screen = async function (options) {
|
|
|
13963
13963
|
}
|
|
13964
13964
|
let node = structuredClone(viewDoc.progUi);
|
|
13965
13965
|
if (!node.length) return console.warn('ui node empty');
|
|
13966
|
-
const
|
|
13966
|
+
const ret_render_$container = await func.runtime.render.render_ui_tree(
|
|
13967
13967
|
SESSION_ID,
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
SESSION_ID,
|
|
13973
|
-
$container: $rootFrame,
|
|
13974
|
-
parent_infoP: null,
|
|
13975
|
-
paramsP: params,
|
|
13968
|
+
$rootFrame,
|
|
13969
|
+
node[0],
|
|
13970
|
+
null,
|
|
13971
|
+
params,
|
|
13976
13972
|
jobNoP,
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
$
|
|
13983
|
-
|
|
13973
|
+
null,
|
|
13974
|
+
null,
|
|
13975
|
+
null,
|
|
13976
|
+
null,
|
|
13977
|
+
null,
|
|
13978
|
+
$rootFrame,
|
|
13979
|
+
);
|
|
13984
13980
|
|
|
13985
13981
|
if (!is_panelP) func.UI.utils.indicator.screen.normal();
|
|
13986
13982
|
|
|
@@ -17956,6 +17952,40 @@ const wait_for_runtime_asset_load = function (node) {
|
|
|
17956
17952
|
});
|
|
17957
17953
|
};
|
|
17958
17954
|
|
|
17955
|
+
const is_runtime_tailwind_script_src = function (src) {
|
|
17956
|
+
const normalized_src = `${src || ''}`.trim().toLowerCase();
|
|
17957
|
+
if (!normalized_src) {
|
|
17958
|
+
return false;
|
|
17959
|
+
}
|
|
17960
|
+
|
|
17961
|
+
return normalized_src.includes('cdn.tailwindcss.com') || /(?:^|\/)tailwind\.cdn\.js(?:[?#].*)?$/.test(normalized_src);
|
|
17962
|
+
};
|
|
17963
|
+
|
|
17964
|
+
const is_runtime_tailwind_config_script = function (content) {
|
|
17965
|
+
return /(?:^|[^\w.])tailwind\.config\s*=/.test(`${content || ''}`);
|
|
17966
|
+
};
|
|
17967
|
+
|
|
17968
|
+
const has_runtime_tailwind = function () {
|
|
17969
|
+
const win = func.runtime.platform.get_window?.();
|
|
17970
|
+
return !!win?.tailwind;
|
|
17971
|
+
};
|
|
17972
|
+
|
|
17973
|
+
const refresh_runtime_tailwind = async function () {
|
|
17974
|
+
const win = func.runtime.platform.get_window?.();
|
|
17975
|
+
const refresh = win?.tailwind?.refresh;
|
|
17976
|
+
if (typeof refresh !== 'function') {
|
|
17977
|
+
return false;
|
|
17978
|
+
}
|
|
17979
|
+
|
|
17980
|
+
try {
|
|
17981
|
+
await refresh();
|
|
17982
|
+
return true;
|
|
17983
|
+
} catch (error) {
|
|
17984
|
+
console.error(error);
|
|
17985
|
+
return false;
|
|
17986
|
+
}
|
|
17987
|
+
};
|
|
17988
|
+
|
|
17959
17989
|
const remove_runtime_head_asset = function (node) {
|
|
17960
17990
|
if (node?.parentNode?.removeChild) {
|
|
17961
17991
|
node.parentNode.removeChild(node);
|
|
@@ -18126,10 +18156,16 @@ const render_runtime_html_asset = async function (options) {
|
|
|
18126
18156
|
}
|
|
18127
18157
|
case 'script': {
|
|
18128
18158
|
const src = `${attributes.src || ''}`.trim();
|
|
18159
|
+
const is_tailwind_script = is_runtime_tailwind_script_src(src);
|
|
18160
|
+
const is_tailwind_config_script = is_runtime_tailwind_config_script(content);
|
|
18129
18161
|
if (!src && !content.trim()) {
|
|
18130
18162
|
return options.$container;
|
|
18131
18163
|
}
|
|
18132
18164
|
queue_runtime_html_script_task(async function () {
|
|
18165
|
+
if (src && is_tailwind_script && has_runtime_tailwind()) {
|
|
18166
|
+
return;
|
|
18167
|
+
}
|
|
18168
|
+
|
|
18133
18169
|
await upsert_runtime_head_element({
|
|
18134
18170
|
tag_name,
|
|
18135
18171
|
attributes,
|
|
@@ -18144,6 +18180,10 @@ const render_runtime_html_asset = async function (options) {
|
|
|
18144
18180
|
: null,
|
|
18145
18181
|
await_load: !!src,
|
|
18146
18182
|
});
|
|
18183
|
+
|
|
18184
|
+
if (is_tailwind_config_script) {
|
|
18185
|
+
await refresh_runtime_tailwind();
|
|
18186
|
+
}
|
|
18147
18187
|
});
|
|
18148
18188
|
return options.$container;
|
|
18149
18189
|
}
|