arcane-os 0.42.1 → 0.43.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/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/docs/reference/runtime-components.md +63 -10
- package/docs/reference/runtime-modules.md +68 -3
- package/package.json +1 -1
- package/runtime/arcane/components/browser-ai-setup.html +1 -1
- package/runtime/arcane/components/calculator.html +1 -1
- package/runtime/arcane/components/chart.html +1 -1
- package/runtime/arcane/components/chat.html +2 -2
- package/runtime/arcane/components/conversation-view.html +1 -1
- package/runtime/arcane/components/dashboard-config.html +4 -4
- package/runtime/arcane/components/data-maintenance.html +3 -3
- package/runtime/arcane/components/data-view.html +138 -53
- package/runtime/arcane/components/directory-picker.html +2 -2
- package/runtime/arcane/components/file-drop.html +1 -1
- package/runtime/arcane/components/file-inspector.html +1 -1
- package/runtime/arcane/components/file-manager.html +217 -35
- package/runtime/arcane/components/integration-settings.html +1 -1
- package/runtime/arcane/components/local-ai-status.html +1 -1
- package/runtime/arcane/components/markdown-document.html +4 -4
- package/runtime/arcane/components/markdown-editor.html +72 -2
- package/runtime/arcane/components/media-embed.html +1 -1
- package/runtime/arcane/components/modal.html +9 -5
- package/runtime/arcane/components/output-panel.html +1 -1
- package/runtime/arcane/components/preferences-form.html +1 -1
- package/runtime/arcane/components/pwa-install.html +2 -2
- package/runtime/arcane/components/screen-capture.html +1 -1
- package/runtime/arcane/components/source-code-viewer.html +3 -3
- package/runtime/arcane/components/speech.html +1 -1
- package/runtime/arcane/components/summary-strip.html +1 -1
- package/runtime/arcane/components/table.html +1 -1
- package/runtime/arcane/components/task-progress.html +1 -1
- package/runtime/arcane/components/terminal-workspace.html +1 -1
- package/runtime/arcane/components/theme-editor.html +1 -1
- package/runtime/arcane/components/unified-inbox.html +1 -1
- package/runtime/arcane/components/voice-transcription.html +2 -2
- package/runtime/arcane/components/weather-widget.html +1 -1
- package/runtime/arcane/components/web-navigator.html +2 -2
- package/runtime/arcane/modules/ArcaneNavigationPolicy.js +1 -1
- package/runtime/arcane/modules/CommunicationAppController.js +2 -2
- package/runtime/arcane/modules/CommunicationHub.js +1 -1
- package/runtime/arcane/modules/ConversationClosingReport.js +1 -1
- package/runtime/arcane/modules/Errors.js +1 -1
- package/runtime/arcane/modules/HTMLImport.js +19 -38
- package/runtime/arcane/modules/LocalAIReadinessController.js +1 -1
- package/runtime/arcane/modules/PrintView.js +625 -0
- package/runtime/arcane/modules/ScamRiskPolicy.js +1 -1
- package/src/dev-server.mjs +2 -2
- package/src/import-map.mjs +66 -145
- package/src/packager/core.mjs +3 -4
- package/src/templates/workspace-template.mjs +5 -5
- package/src/workspace-runtime.mjs +6 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/theme.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/theme.css"><link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
2
2
|
<style>:host{display:block}.capture{display:grid;gap:var(--arcane-space-4)}.actions{display:grid;gap:var(--arcane-space-3);grid-template-columns:repeat(3,minmax(0,1fr))}.action{display:grid;gap:var(--arcane-space-2);padding:var(--arcane-space-4);text-align:left}.action strong{font-size:1.05rem}.action span{color:var(--arcane-muted);font-size:.85rem}.recording{align-items:center;display:flex;gap:var(--arcane-space-3);justify-content:space-between;padding:var(--arcane-space-3);border:1px solid var(--arcane-border);border-radius:var(--arcane-radius-medium)}.preview{display:grid;place-items:center;min-height:16rem;overflow:auto;background:var(--arcane-surface-muted);border:1px solid var(--arcane-border);border-radius:var(--arcane-radius-large)}.preview :where(img,video){display:block}.empty{color:var(--arcane-muted);text-align:center}.status{margin:0;color:var(--arcane-muted)}@media(max-width:44rem){.actions{grid-template-columns:1fr}}</style>
|
|
3
3
|
<section class="capture"><div class="actions"><button class="action arcane-card" type="button" data-capture="image"><strong>Screenshot</strong><span>Capture the selected display as PNG.</span></button><button class="action arcane-card" type="button" data-capture="video"><strong>Record video</strong><span>Record the selected display in a browser-supported video format.</span></button><button class="action arcane-card" type="button" data-capture="gif"><strong>Record GIF</strong><span>Record the selected display as an animated GIF.</span></button></div><div id="recording" class="recording" hidden><span id="recordingLabel">Recording…</span><button id="stop" class="arcane-button" type="button">Stop recording</button></div><div id="preview" class="preview"><div class="empty"><strong>No capture yet</strong><p>Your capture remains on this device unless you choose to save it.</p></div></div><p id="status" class="status" role="status" aria-live="polite">Choose a capture type. Your browser will ask which display to share.</p></section>
|
|
4
4
|
<script type="module">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/layout.css
|
|
2
|
-
<link rel="stylesheet" href="./arcane/css/theme.css
|
|
3
|
-
<link rel="stylesheet" href="./arcane/css/primitives.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/layout.css">
|
|
2
|
+
<link rel="stylesheet" href="./arcane/css/theme.css">
|
|
3
|
+
<link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
4
4
|
|
|
5
5
|
<style>
|
|
6
6
|
:host{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/primitives.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
2
2
|
<style>
|
|
3
3
|
:host{display:block;height:100%;min-height:18rem;--terminal-bg:var(--background,rgb(244, 246, 251));--terminal-fg:var(--text-color,rgb(23, 34, 56));--terminal-muted:var(--muted-text-color,rgb(95, 107, 130));--terminal-accent:var(--focus-color,rgb(118, 87, 213));--terminal-danger:var(--danger-color,rgb(165, 56, 56));--terminal-font:ui-monospace,"Cascadia Code","SFMono-Regular",Consolas,monospace;--terminal-font-size:14px;--terminal-line-height:1.55;--terminal-opacity:1}
|
|
4
4
|
*{box-sizing:border-box}.workspace{background:color-mix(in srgb,var(--terminal-bg) calc(var(--terminal-opacity)*100%),transparent);border:1px solid color-mix(in srgb,var(--terminal-accent) 20%,transparent);border-radius:.85rem;color:var(--terminal-fg);display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;height:100%;overflow:visible;box-shadow:0 1.5rem 5rem rgba(0,0,0,.28)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/primitives.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
2
2
|
<style>
|
|
3
3
|
:host{display:block;min-width:0}.intro{display:grid;gap:var(--arcane-space-1)}.intro p{margin:0}.editor{display:grid;gap:var(--arcane-space-4)}.identity{display:grid;gap:var(--arcane-space-4);grid-template-columns:2fr 1fr}.colors{display:grid;gap:var(--arcane-space-3);grid-template-columns:repeat(auto-fit,minmax(11rem,1fr))}.color-field{align-items:center;display:grid;gap:.65rem;grid-template-columns:2.5rem minmax(0,1fr)}.color-field input{height:2.5rem;padding:.15rem;width:2.5rem}.color-field label{font-weight:650}.status{margin-right:auto;min-height:1.4em}.preview{border:1px solid var(--border-color);border-radius:var(--arcane-radius-medium);display:flex;gap:.6rem;padding:.8rem;background:var(--background);color:var(--text-color)}.preview span{border-radius:.4rem;padding:.5rem .7rem;background:var(--secondary-color)}.preview strong{border-radius:.4rem;padding:.5rem .7rem;background:var(--primary-color);color:var(--button-text-color)}@media(max-width:36rem){.identity{grid-template-columns:1fr}}
|
|
4
4
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/primitives.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
2
2
|
<style>
|
|
3
3
|
:host{display:block;min-width:0}.toolbar{display:grid;gap:.75rem;padding:1rem;border-bottom:1px solid var(--border-color,#ccd4df)}.toolbar-row{display:flex;gap:.5rem}.toolbar input{min-width:0;width:100%}.filters{display:flex;flex-wrap:wrap;gap:.4rem}.filters button{overflow-wrap:anywhere}.list{display:grid}.thread{display:grid;gap:.35rem;width:100%;padding:1rem;border:0;border-bottom:1px solid var(--border-color,#ccd4df);color:inherit;background:transparent;text-align:left}.thread:hover,.thread[aria-current="true"]{background:var(--secondary-color,#e8edf4)}.thread:focus-visible{outline:.18rem solid var(--focus-color,#7657d5);outline-offset:-.2rem}.line{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:space-between}.title{font-weight:750;overflow-wrap:anywhere}.preview{color:var(--muted-text-color,#607080);overflow-wrap:anywhere}.meta{align-items:center;display:flex;flex-wrap:wrap;gap:.4rem;font-size:.75rem}.badge{border:1px solid var(--border-color,#ccd4df);border-radius:999px;padding:.15rem .45rem;text-transform:uppercase}.unread{display:grid;place-items:center;min-width:1.4rem;height:1.4rem;border-radius:999px;color:var(--button-text-color,#fff);background:var(--focus-color,#7657d5);font-weight:800}.empty{padding:2rem;text-align:center}.empty p{color:var(--muted-text-color,#607080)}
|
|
4
4
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/layout.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/layout.css">
|
|
2
2
|
<style>
|
|
3
3
|
:host{
|
|
4
4
|
display:block;
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
{requestAIRuntimeIntent,subscribeAIRuntimeState},
|
|
139
139
|
{default:ContinuousVoiceCapture}
|
|
140
140
|
]=await Promise.all([
|
|
141
|
-
import('../modules/MD.js
|
|
141
|
+
import('../modules/MD.js'),
|
|
142
142
|
import('../modules/ComponentContracts.js'),
|
|
143
143
|
import('../modules/AIRuntimeState.js'),
|
|
144
144
|
import('../modules/ContinuousVoiceCapture.js')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/theme.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/theme.css"><link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
2
2
|
<style>:host{display:block}.widget{display:grid;gap:var(--arcane-space-4)}.current{align-items:center;display:grid;gap:var(--arcane-space-4);grid-template-columns:auto 1fr auto}.symbol{font-size:clamp(2.5rem,8vw,5rem);line-height:1}.temperature{font-size:clamp(2.2rem,7vw,4.5rem);font-weight:760;line-height:1}.location h2,.location p{margin:0}.location p,.details{color:var(--arcane-muted)}.details{display:grid;gap:var(--arcane-space-1);text-align:right}.forecast{display:grid;gap:var(--arcane-space-2);grid-template-columns:repeat(7,minmax(5.5rem,1fr));overflow:auto}.day{display:grid;gap:var(--arcane-space-2);padding:var(--arcane-space-3);text-align:center;background:var(--arcane-surface-muted);border:1px solid var(--arcane-border);border-radius:var(--arcane-radius-medium)}.day strong{white-space:nowrap}.day-symbol{font-size:1.8rem}.empty{padding:var(--arcane-space-6);text-align:center;color:var(--arcane-muted)}.footer{display:flex;align-items:center;justify-content:space-between;gap:var(--arcane-space-3)}@media(max-width:36rem){.current{grid-template-columns:auto 1fr}.details{grid-column:1/-1;text-align:left;grid-template-columns:repeat(3,1fr)}}</style>
|
|
3
3
|
<section class="widget arcane-card"><div id="empty" class="empty"><strong>Weather is ready for a location</strong><p>Search for a city or postal code to load current conditions and the forecast.</p></div><div id="content" hidden><div class="arcane-card__body current"><span id="symbol" class="symbol" aria-hidden="true"></span><div class="location"><h2 id="location" class="arcane-section-heading"></h2><p id="condition"></p><div><span id="temperature" class="temperature"></span></div></div><div class="details"><span id="feels"></span><span id="humidity"></span><span id="wind"></span></div></div><div id="forecast" class="arcane-card__body forecast"></div><footer class="arcane-card__footer footer"><span id="source" class="arcane-help"></span><button id="refresh" class="arcane-button arcane-button--secondary" type="button">Refresh</button></footer></div></section>
|
|
4
4
|
<script type="module">const host=this,root=host.shadowRoot,empty=root.querySelector('#empty'),content=root.querySelector('#content'),forecast=root.querySelector('#forecast');const {createArcaneEventSource,projectArcaneDOMEvent}=await import('arcane-os/event-manager');const events=createArcaneEventSource(host,{source:'arcane.component.weather-widget',eventTypes:['weather-refresh','weather-widget-ready']});let weather=null,destroyed=false;const conditions=new Map([[0,['Clear','☀️']],[1,['Mostly clear','🌤️']],[2,['Partly cloudy','⛅']],[3,['Overcast','☁️']],[45,['Fog','🌫️']],[48,['Freezing fog','🌫️']],[51,['Light drizzle','🌦️']],[53,['Drizzle','🌦️']],[55,['Heavy drizzle','🌧️']],[61,['Light rain','🌦️']],[63,['Rain','🌧️']],[65,['Heavy rain','🌧️']],[71,['Light snow','🌨️']],[73,['Snow','🌨️']],[75,['Heavy snow','❄️']],[80,['Rain showers','🌦️']],[81,['Rain showers','🌧️']],[82,['Heavy showers','⛈️']],[95,['Thunderstorm','⛈️']],[96,['Thunderstorm with hail','⛈️']],[99,['Severe thunderstorm','⛈️']]]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./arcane/css/theme.css
|
|
2
|
-
<link rel="stylesheet" href="./arcane/css/primitives.css
|
|
1
|
+
<link rel="stylesheet" href="./arcane/css/theme.css">
|
|
2
|
+
<link rel="stylesheet" href="./arcane/css/primitives.css">
|
|
3
3
|
<style>
|
|
4
4
|
:host{display:block;height:100%;min-height:30rem}
|
|
5
5
|
.navigator{display:grid;grid-template-rows:auto 1fr auto;height:100%;min-height:30rem}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Is from 'strong-type';
|
|
2
2
|
const is=new Is(false);
|
|
3
3
|
|
|
4
|
-
import * as ArcaneNetworkPolicy from './ArcaneNetworkPolicy.js
|
|
4
|
+
import * as ArcaneNetworkPolicy from './ArcaneNetworkPolicy.js';
|
|
5
5
|
|
|
6
6
|
function completeText(value,fallback){
|
|
7
7
|
return is.string(value)&&value.length>0?value:fallback;
|
|
@@ -3,13 +3,13 @@ const is=new Is(false);
|
|
|
3
3
|
|
|
4
4
|
import { arcaneLogging } from 'arcane-os/logging';
|
|
5
5
|
import ArcaneCommunicationBridge from './ArcaneCommunicationBridge.js';
|
|
6
|
-
import CommunicationHub from './CommunicationHub.js
|
|
6
|
+
import CommunicationHub from './CommunicationHub.js';
|
|
7
7
|
import CommunicationPreferences from './CommunicationPreferences.js';
|
|
8
8
|
import {loadAndApplyTheme} from './ThemeManager.js';
|
|
9
9
|
import {
|
|
10
10
|
inspectMessageRecords,
|
|
11
11
|
unavailableMessageInspection
|
|
12
|
-
} from './MessageAdvisory.js
|
|
12
|
+
} from './MessageAdvisory.js';
|
|
13
13
|
|
|
14
14
|
export const COMMUNICATION_APP_CONTROLLER_ERROR_CODES={
|
|
15
15
|
destroyed:'ARCANE_COMMUNICATION_APP_CONTROLLER_DESTROYED'
|
|
@@ -4,7 +4,7 @@ const is=new Is(false);
|
|
|
4
4
|
import {createArcaneEventSource} from 'arcane-os/event-manager';
|
|
5
5
|
import CommunicationMessage from '../entities/CommunicationMessage.js';
|
|
6
6
|
import CommunicationThread from '../entities/CommunicationThread.js';
|
|
7
|
-
import CommunicationProviderRegistry from './CommunicationProviderRegistry.js
|
|
7
|
+
import CommunicationProviderRegistry from './CommunicationProviderRegistry.js';
|
|
8
8
|
|
|
9
9
|
const communicationHubEvents={
|
|
10
10
|
refreshCancelled:'communications-refresh-cancelled',
|
|
@@ -4,7 +4,7 @@ const is=new Is(false);
|
|
|
4
4
|
import {
|
|
5
5
|
CONVERSATION_ACTION_ITEM_BASES,
|
|
6
6
|
normalizeRememberedConversationActions
|
|
7
|
-
} from './ConversationActionItems.js
|
|
7
|
+
} from './ConversationActionItems.js';
|
|
8
8
|
|
|
9
9
|
const DEFAULT_TOOL_NAME='prepare_conversation_closing_report';
|
|
10
10
|
const TOOL_NAME_PATTERN=/^[a-z][a-z0-9_]*$/;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
const DEFAULT_DELAY_MS=2_000;
|
|
12
12
|
const LEDGER_STORAGE_KEY='arcane-global-errors-v1';
|
|
13
13
|
const HANDLER_MARKER=Symbol.for('arcane.global-errors.handler');
|
|
14
|
-
const DEVELOPER_MODAL_HREF=new URL('../components/modal.html
|
|
14
|
+
const DEVELOPER_MODAL_HREF=new URL('../components/modal.html',import.meta.url).href;
|
|
15
15
|
const ERROR_EVENT_TYPES={
|
|
16
16
|
browserErrorCaptured:'arcane-error-captured',
|
|
17
17
|
unhandledRejectionCaptured:'arcane-unhandled-rejection-captured'
|
|
@@ -17,15 +17,9 @@ globalThis[htmlImportHostRegistryKey]=htmlImportHostRegistry;
|
|
|
17
17
|
let htmlImportScriptId=0;
|
|
18
18
|
|
|
19
19
|
const htmlImportModuleURL=new URL(import.meta.url);
|
|
20
|
-
const htmlImportAssetVersion=htmlImportModuleURL.searchParams.get('arcaneVersion');
|
|
21
20
|
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function versionComponentResource(value,baseHref){
|
|
27
|
-
const clean=pwaResourceUrlsEnabled();
|
|
28
|
-
if((!htmlImportAssetVersion&&!clean)||!is.string(value)||!value||value.startsWith('#')){
|
|
21
|
+
function cleanComponentResource(value,baseHref){
|
|
22
|
+
if(!is.string(value)||!value||value.startsWith('#')){
|
|
29
23
|
return value;
|
|
30
24
|
}
|
|
31
25
|
let resolvedURL;
|
|
@@ -43,32 +37,20 @@ function versionComponentResource(value,baseHref){
|
|
|
43
37
|
const fragment=fragmentIndex<0?'':value.slice(fragmentIndex);
|
|
44
38
|
const resource=fragmentIndex<0?value:value.slice(0,fragmentIndex);
|
|
45
39
|
const queryIndex=resource.indexOf('?');
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const fields=query?query.split('&').map(function versionQueryField(field){
|
|
51
|
-
const parameter=new URLSearchParams(field);
|
|
52
|
-
if(parameter.has('v'))return null;
|
|
53
|
-
if(!parameter.has('arcaneVersion'))return field;
|
|
54
|
-
if(clean||replaced)return null;
|
|
55
|
-
replaced=true;
|
|
40
|
+
if(queryIndex<0)return value;
|
|
41
|
+
const pathname=resource.slice(0,queryIndex);
|
|
42
|
+
const query=resource.slice(queryIndex+1);
|
|
43
|
+
const fields=query.split('&').filter(function retainQueryField(field){
|
|
56
44
|
const equals=field.indexOf('=');
|
|
57
45
|
const key=equals<0?field:field.slice(0,equals);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
if(!replaced){
|
|
68
|
-
if(fields.at(-1)==='')fields[fields.length-1]=versionField;
|
|
69
|
-
else fields.push(versionField);
|
|
70
|
-
}
|
|
71
|
-
return `${pathname}?${fields.join('&')}${fragment}`;
|
|
46
|
+
let decodedKey=key;
|
|
47
|
+
try{decodedKey=decodeURIComponent(key.replaceAll('+',' '));}
|
|
48
|
+
catch{decodedKey=key;}
|
|
49
|
+
return decodedKey!=='arcaneVersion';
|
|
50
|
+
});
|
|
51
|
+
return fields.length>0
|
|
52
|
+
?`${pathname}?${fields.join('&')}${fragment}`
|
|
53
|
+
:`${pathname}${fragment}`;
|
|
72
54
|
}
|
|
73
55
|
|
|
74
56
|
function componentRuntimeRoot(resolvedHref){
|
|
@@ -91,7 +73,6 @@ function resolveComponentResource(value,runtimeRoot){
|
|
|
91
73
|
}
|
|
92
74
|
|
|
93
75
|
function resolveComponentStyleResources(styleText,runtimeRoot){
|
|
94
|
-
if(!runtimeRoot&&!htmlImportAssetVersion&&!pwaResourceUrlsEnabled())return styleText;
|
|
95
76
|
const parts=[];
|
|
96
77
|
let copiedThrough=0;
|
|
97
78
|
let index=0;
|
|
@@ -149,7 +130,7 @@ function resolveComponentStyleResources(styleText,runtimeRoot){
|
|
|
149
130
|
const resourcePath=styleText.slice(start,end);
|
|
150
131
|
// CSS escapes retain their original spelling until their URL syntax is decoded.
|
|
151
132
|
if(resourcePath.includes('\\'))return;
|
|
152
|
-
const resolved=
|
|
133
|
+
const resolved=cleanComponentResource(
|
|
153
134
|
resolveComponentResource(resourcePath,runtimeRoot),
|
|
154
135
|
document.baseURI
|
|
155
136
|
);
|
|
@@ -237,7 +218,7 @@ function createComponentFragment(html,resolvedHref){
|
|
|
237
218
|
const resolved=resolveComponentResource(value,runtimeRoot);
|
|
238
219
|
const navigation=attribute==='href'
|
|
239
220
|
&&['a','area','base'].includes(element.localName);
|
|
240
|
-
const versioned=navigation?resolved:
|
|
221
|
+
const versioned=navigation?resolved:cleanComponentResource(
|
|
241
222
|
resolved,
|
|
242
223
|
element.localName==='script'?resolvedHref:document.baseURI
|
|
243
224
|
);
|
|
@@ -257,7 +238,7 @@ function resolveRelativeDynamicImports(source,baseHref){
|
|
|
257
238
|
return source.replace(
|
|
258
239
|
/\bimport\s*\(\s*(['"])(\.{1,2}\/[^'"]+)\1\s*\)/gu,
|
|
259
240
|
function resolveDynamicImport(_match,_quote,specifier){
|
|
260
|
-
const resolved=
|
|
241
|
+
const resolved=cleanComponentResource(new URL(specifier,baseHref).href,baseHref);
|
|
261
242
|
return `import(${JSON.stringify(resolved)})`;
|
|
262
243
|
}
|
|
263
244
|
);
|
|
@@ -327,7 +308,7 @@ class HTMLImport extends HTMLElement {
|
|
|
327
308
|
|
|
328
309
|
try{
|
|
329
310
|
const resolvedURL=new URL(href,document.baseURI);
|
|
330
|
-
resolvedHref=
|
|
311
|
+
resolvedHref=cleanComponentResource(resolvedURL.href,document.baseURI);
|
|
331
312
|
const response=await fetch(resolvedHref,{
|
|
332
313
|
cache:'default',
|
|
333
314
|
method:'GET',
|
|
@@ -497,7 +478,7 @@ class HTMLImport extends HTMLElement {
|
|
|
497
478
|
let sourceBaseHref=contentBaseHref;
|
|
498
479
|
const scriptSource=script.getAttribute('src');
|
|
499
480
|
if(scriptSource!==null){
|
|
500
|
-
const requestedScriptHref=
|
|
481
|
+
const requestedScriptHref=cleanComponentResource(
|
|
501
482
|
new URL(scriptSource,contentBaseHref).href,
|
|
502
483
|
contentBaseHref
|
|
503
484
|
);
|