@tempots/beatui 0.78.2 → 0.79.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/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +66 -66
- package/dist/beatui.css +127 -7
- package/dist/beatui.tailwind.css +127 -7
- package/dist/json-schema/index.cjs.js +6 -6
- package/dist/json-schema/index.es.js +2445 -2436
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +6 -8
- package/package.json +6 -6
package/dist/monaco/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tempots/dom"),A=require("../timer-BJHOsuS6.cjs"),B=require("../link-portal-_tiDFZqh.cjs"),I=require("../theme-Dt6lCAvY.cjs"),p="https://cdn.jsdelivr.net/npm/monaco-editor@0.
|
|
2
|
-
`),i=new Blob([a],{type:"text/javascript"});return URL.createObjectURL(i)};self.MonacoEnvironment={getWorkerUrl(a,i){return t()}}}const F=e=>new Promise((t,a)=>{if(document.querySelector(`script[src="${e}"]`))return t();const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tempots/dom"),A=require("../timer-BJHOsuS6.cjs"),B=require("../link-portal-_tiDFZqh.cjs"),I=require("../theme-Dt6lCAvY.cjs"),p="https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/",W=e=>{if(!e||typeof e!="object")return!1;const t=e;return!!(t.editor&&typeof t.editor.create=="function"&&t.languages)};function M(){if(typeof self>"u")return;const e=self.MonacoEnvironment;if(e&&(typeof e.getWorkerUrl=="function"||typeof e.getWorker=="function"))return;const t=()=>{const a=[`self.MonacoEnvironment = { baseUrl: '${p}' };`,`importScripts('${p}vs/base/worker/workerMain.js');`].join(`
|
|
2
|
+
`),i=new Blob([a],{type:"text/javascript"});return URL.createObjectURL(i)};self.MonacoEnvironment={getWorkerUrl(a,i){return t()}}}const F=e=>new Promise((t,a)=>{if(document.querySelector(`script[src="${e}"]`))return t();const r=document.createElement("script");r.src=e,r.async=!0;const l=document.querySelector("script[nonce]")?.getAttribute("nonce");l&&r.setAttribute("nonce",l),r.onload=()=>t(),r.onerror=h=>{console.error("[BeatUI] Failed to load script",e,h),a(new Error(`Failed to load script ${e}`))},document.head.appendChild(r)}),R=async()=>{const e=window;if((!e.require||!e.require.config)&&(await F(`${p}vs/loader.js`),await new Promise(t=>setTimeout(t,100)),!e.require))throw new Error("AMD loader failed to initialize");return e.require.config?.({baseUrl:p,paths:{vs:"vs"}}),e.require},$=async()=>{const e=window;if(e.monaco&&W(e.monaco))return e.monaco;M();const t=await R();if(await new Promise((a,i)=>{const r=setTimeout(()=>i(new Error("Timeout loading editor.main")),3e4);try{t(["vs/editor/editor.main"],()=>{clearTimeout(r),a()},l=>{clearTimeout(r),i(l)})}catch(l){clearTimeout(r),i(l)}}),!e.monaco)throw new Error("Monaco failed to initialize after loading editor.main");return e.monaco};let w=null;const v=new Map;let g=!1;async function S(){if(w)return w;!g&&typeof window<"u"&&(M(),g=!0);const e=await $();return w=e,e}async function _(e){if(v.has(e))return v.get(e);const t=(async()=>{const a=await S();switch(e){case"typescript":case"javascript":{a.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),a.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1});break}case"json":{a.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[],enableSchemaRequest:!0});break}case"css":case"scss":case"less":{a.css.cssDefaults.setOptions({validate:!0});break}case"html":break;case"markdown":break;case"yaml":{a.languages.getLanguages().some(r=>r.id==="yaml")||a.languages.register({id:"yaml",extensions:[".yml",".yaml"]});break}}})();return v.set(e,t),t}async function O(e){const[t]=await Promise.all([S(),_(e)]);return t}function z(e){if(typeof window>"u")return;const t=window;e?(t.MonacoEnvironment={getWorker:e},g=!0):t.MonacoEnvironment||(M(),g=!0)}const N=e=>{const{value:t,onChange:a,onBlur:i,language:r="plaintext",readOnly:l=!1,editorOptions:h,jsonSchemas:V,autofocus:j,class:q,disabled:D,hasError:x,id:C,name:L,placeholder:P}=e,b=o.Value.toSignal(l);return o.Use(I.Theme,({appearance:T})=>o.html.div((e.cssInjection??"none")==="none"?null:o.Task(()=>Promise.resolve().then(()=>require("../styles-url-CZUL_YRT.cjs")),({default:u})=>B.LinkPortal({id:"beatui-monaco-css",href:u})),o.attr.class("bc-monaco-editor-container"),o.attr.class(q),o.attr.class(o.Value.map(x??!1,u=>u?"bc-input-container--error":"")),o.attr.id(C),o.attr.name(L),o.WithElement(u=>{let m=null;const c=[];return(async()=>{try{let d=function(){const n=s.getValue();a?.(n)};const f=o.Value.get(r)??"plaintext";if(m=(await O(f)).editor.create(u,{value:o.Value.get(t)??"",language:f,readOnly:o.Value.get(b)??!1,automaticLayout:!0,minimap:{enabled:!1},...h??{}}),!m)throw new Error("Failed to create Monaco editor");const s=m;c.push(o.effectOf(r,V)(async(n,y)=>{const E=await O(n);if(n==="json"){const U={validate:!0,enableSchemaRequest:!0,schemas:!!(y&&y.length)?y:[]};E.json.jsonDefaults.setDiagnosticsOptions(U)}const k=s.getModel();k&&E.editor.setModelLanguage(k,n)})),c.push(s.onDidChangeModelContent(A.x(500,d)).dispose),c.push(s.onDidBlurEditorText(()=>{d(),i?.()}).dispose),c.push(o.Value.on(t,n=>{n!==s.getValue()&&s.setValue(n??"")})),c.push(o.Value.on(b,n=>{s.updateOptions({readOnly:n??!1})})),c.push(o.Value.on(D??!1,n=>{s.updateOptions({readOnly:n??!1})})),c.push(o.Value.on(j??!1,n=>{n&&s.focus()})),c.push(o.Value.on(P??"",n=>{s.updateOptions({placeholder:n??""})})),c.push(T.on(n=>{s.updateOptions({theme:n==="dark"?"vs-dark":"vs"})}))}catch(d){console.error("[BeatUI] Failed to initialize Monaco editor:",d);const f=u;f.textContent="Failed to load Monaco Editor. Please ensure monaco-editor is installed."}})(),o.OnDispose(()=>{try{c.forEach(d=>d())}catch{}try{m?.dispose()}catch{}})})))};exports.MonacoEditorInput=N;exports.configureMonacoEnvironment=z;
|
package/dist/monaco/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Value as c, Use as B, html as W, Task as F, attr as m, WithElement as I
|
|
|
2
2
|
import { x as _ } from "../timer-Rd2sKnvH.js";
|
|
3
3
|
import { L as z } from "../link-portal-Cr2l9f3k.js";
|
|
4
4
|
import { T as N } from "../theme-B5pmbvQ_.js";
|
|
5
|
-
const g = "https://cdn.jsdelivr.net/npm/monaco-editor@0.
|
|
5
|
+
const g = "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/", G = (e) => {
|
|
6
6
|
if (!e || typeof e != "object") return !1;
|
|
7
7
|
const o = e;
|
|
8
8
|
return !!(o.editor && typeof o.editor.create == "function" && o.languages);
|
|
@@ -84,17 +84,17 @@ async function X(e) {
|
|
|
84
84
|
switch (e) {
|
|
85
85
|
case "typescript":
|
|
86
86
|
case "javascript": {
|
|
87
|
-
n.
|
|
87
|
+
n.typescript.javascriptDefaults.setDiagnosticsOptions({
|
|
88
88
|
noSemanticValidation: !1,
|
|
89
89
|
noSyntaxValidation: !1
|
|
90
|
-
}), n.
|
|
90
|
+
}), n.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
91
91
|
noSemanticValidation: !1,
|
|
92
92
|
noSyntaxValidation: !1
|
|
93
93
|
});
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
case "json": {
|
|
97
|
-
n.
|
|
97
|
+
n.json.jsonDefaults.setDiagnosticsOptions({
|
|
98
98
|
validate: !0,
|
|
99
99
|
schemas: [],
|
|
100
100
|
enableSchemaRequest: !0
|
|
@@ -104,7 +104,7 @@ async function X(e) {
|
|
|
104
104
|
case "css":
|
|
105
105
|
case "scss":
|
|
106
106
|
case "less": {
|
|
107
|
-
n.
|
|
107
|
+
n.css.cssDefaults.setOptions({
|
|
108
108
|
validate: !0
|
|
109
109
|
});
|
|
110
110
|
break;
|
|
@@ -204,9 +204,7 @@ const se = (e) => {
|
|
|
204
204
|
enableSchemaRequest: !0,
|
|
205
205
|
schemas: !!(y && y.length) ? y : []
|
|
206
206
|
};
|
|
207
|
-
k.
|
|
208
|
-
P
|
|
209
|
-
);
|
|
207
|
+
k.json.jsonDefaults.setDiagnosticsOptions(P);
|
|
210
208
|
}
|
|
211
209
|
const O = s.getModel();
|
|
212
210
|
O && k.editor.setModelLanguage(O, t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/beatui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@eslint/js": "^9.39.1",
|
|
125
125
|
"@tempots/dom": "^35.0.3",
|
|
126
|
-
"@tempots/eslint-plugin": "0.
|
|
126
|
+
"@tempots/eslint-plugin": "0.8.1",
|
|
127
127
|
"@tempots/std": "~0.25.2",
|
|
128
128
|
"@tempots/ui": "^14.0.3",
|
|
129
129
|
"@testing-library/dom": "10.4.0",
|
|
@@ -131,10 +131,10 @@
|
|
|
131
131
|
"@types/node": "22.15.18",
|
|
132
132
|
"@typescript-eslint/eslint-plugin": "8.46.0",
|
|
133
133
|
"@typescript-eslint/parser": "8.46.0",
|
|
134
|
-
"@vitest/coverage-v8": "^
|
|
134
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
135
135
|
"eslint": "9.37.0",
|
|
136
136
|
"eslint-config-prettier": "10.1.8",
|
|
137
|
-
"jsdom": "
|
|
137
|
+
"jsdom": "27.4.0",
|
|
138
138
|
"pdfjs-dist": "5.4.394",
|
|
139
139
|
"prettier": "3.6.2",
|
|
140
140
|
"tailwindcss": "4.1.14",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"typescript": "5.9.3",
|
|
143
143
|
"typescript-eslint": "8.46.0",
|
|
144
144
|
"vite": "7.1.9",
|
|
145
|
-
"vitest": "
|
|
145
|
+
"vitest": "4.0.17"
|
|
146
146
|
},
|
|
147
147
|
"dependencies": {
|
|
148
148
|
"@js-temporal/polyfill": "^0.5.1",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"markdown-it": "^14.1.0",
|
|
156
156
|
"micromark": "^4.0.2",
|
|
157
157
|
"micromark-extension-gfm": "^3.0.0",
|
|
158
|
-
"monaco-editor": "0.
|
|
158
|
+
"monaco-editor": "0.55.1",
|
|
159
159
|
"prosemirror-commands": "^1.7.1",
|
|
160
160
|
"prosemirror-history": "^1.4.1",
|
|
161
161
|
"prosemirror-keymap": "^1.2.3",
|