monacozen 0.2.0 → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  import { m as e } from "./editor.api-ZYFspLPt.js";
2
2
  import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v } from "./lspLanguageFeatures-D6P77uh_.js";
3
- import { r as y } from "./monaco-o5F6wkXp.js";
3
+ import { r as y } from "./monaco-DEq8WAj8.js";
4
4
  //#region node_modules/.bun/monaco-editor@0.57.0/node_modules/monaco-editor/esm/vs/languages/features/css/workerManager.js
5
5
  var b = 12e4, x = class {
6
6
  constructor(e) {
@@ -1,6 +1,6 @@
1
1
  import { m as e } from "./editor.api-ZYFspLPt.js";
2
2
  import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v } from "./lspLanguageFeatures-D6P77uh_.js";
3
- import { r as y } from "./monaco-o5F6wkXp.js";
3
+ import { r as y } from "./monaco-DEq8WAj8.js";
4
4
  //#region node_modules/.bun/monaco-editor@0.57.0/node_modules/monaco-editor/esm/vs/languages/features/html/workerManager.js
5
5
  var b = 12e4, x = class {
6
6
  constructor(e) {
@@ -1,6 +1,6 @@
1
1
  import { m as e, p as t } from "./editor.api-ZYFspLPt.js";
2
2
  import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y } from "./lspLanguageFeatures-D6P77uh_.js";
3
- import { r as b } from "./monaco-o5F6wkXp.js";
3
+ import { r as b } from "./monaco-DEq8WAj8.js";
4
4
  //#region node_modules/.bun/monaco-editor@0.57.0/node_modules/monaco-editor/esm/vs/languages/features/json/workerManager.js
5
5
  var x = 12e4, S = class {
6
6
  constructor(e) {
@@ -36657,7 +36657,7 @@ var lH = "5.9.3", uH = /* @__PURE__ */ Pd({
36657
36657
  onlyVisible: !1
36658
36658
  }, {}, {}, vH), xH = () => CH().then((e) => e.getTypeScriptWorker()), SH = () => CH().then((e) => e.getJavaScriptWorker());
36659
36659
  function CH() {
36660
- return import("./tsMode-C_Fsqh0j.js");
36660
+ return import("./tsMode-DdcTxg_i.js");
36661
36661
  }
36662
36662
  U.onLanguage("typescript", () => CH().then((e) => e.setupTypeScript(yH))), U.onLanguage("javascript", () => CH().then((e) => e.setupJavaScript(bH)));
36663
36663
  //#endregion
@@ -39637,7 +39637,7 @@ var IG = /* @__PURE__ */ Pd({
39637
39637
  documentRangeFormattingEdits: !0
39638
39638
  }, BG = new LG("css", RG, zG), VG = new LG("scss", RG, zG), HG = new LG("less", RG, zG);
39639
39639
  function UG() {
39640
- return import("./cssMode-7U-ime2d.js");
39640
+ return import("./cssMode-BLJVTAbR.js");
39641
39641
  }
39642
39642
  U.onLanguage("less", () => {
39643
39643
  UG().then((e) => e.setupMode(HG));
@@ -39714,7 +39714,7 @@ function qG(e) {
39714
39714
  }
39715
39715
  var JG = "html", YG = "handlebars", XG = "razor", ZG = iK(JG, KG, qG(JG)), QG = ZG.defaults, $G = iK(YG, KG, qG(YG)), eK = $G.defaults, tK = iK(XG, KG, qG(XG)), nK = tK.defaults;
39716
39716
  function rK() {
39717
- return import("./htmlMode-i6u-9r7u.js");
39717
+ return import("./htmlMode-C87jndIO.js");
39718
39718
  }
39719
39719
  function iK(e, t = KG, n = qG(e)) {
39720
39720
  let r = new GG(e, t, n), i, a = U.onLanguage(e, async () => {
@@ -39776,7 +39776,7 @@ var aK = /* @__PURE__ */ Pd({
39776
39776
  selectionRanges: !0
39777
39777
  }), sK = () => cK().then((e) => e.getWorker());
39778
39778
  function cK() {
39779
- return import("./jsonMode-DAP8CNa2.js");
39779
+ return import("./jsonMode-DLDmNGq-.js");
39780
39780
  }
39781
39781
  U.register({
39782
39782
  id: "json",
@@ -40818,7 +40818,10 @@ var Oq = wq({
40818
40818
  ...al,
40819
40819
  createWebWorker: cH
40820
40820
  }
40821
- }, { enableSchemaRequest: !0 }), kq = /* @__PURE__ */ new Map(), Aq = "monacozen://schema/", jq = 1, Mq = /* @__PURE__ */ new Set(), Nq = /* @__PURE__ */ new Set(), Pq = 0, Fq = Promise.resolve(), Iq = (e) => kq.values().filter((t) => t.language === e).toArray(), Lq = () => {
40821
+ }, {
40822
+ enableSchemaRequest: !0,
40823
+ hoverSchemaSource: !1
40824
+ }), kq = /* @__PURE__ */ new Map(), Aq = "monacozen://schema/", jq = 1, Mq = /* @__PURE__ */ new Set(), Nq = /* @__PURE__ */ new Set(), Pq = 0, Fq = Promise.resolve(), Iq = (e) => kq.values().filter((t) => t.language === e).toArray(), Lq = () => {
40822
40825
  let e = oK.diagnosticsOptions, t = (e.schemas ?? []).filter((e) => !Mq.has(e.uri)), n = Iq("json").map((e) => ({
40823
40826
  uri: e.schemaUri,
40824
40827
  fileMatch: [e.modelUri],
@@ -1,5 +1,5 @@
1
1
  import { a as e, c as t, f as n, m as r, o as i, p as a } from "./editor.api-ZYFspLPt.js";
2
- import { n as o, r as s } from "./monaco-o5F6wkXp.js";
2
+ import { n as o, r as s } from "./monaco-DEq8WAj8.js";
3
3
  //#region node_modules/.bun/monaco-editor@0.57.0/node_modules/monaco-editor/esm/vs/languages/features/typescript/workerManager.js
4
4
  var c = class {
5
5
  constructor(e, t) {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"bugs":{"url":"https://github.com/Jaid/monacozen/issues"},"description":"text editor component with batteries included and UI clutter removed","homepage":"https://github.com/Jaid/monacozen#readme","keywords":["editor","monaco","react","text-editor"],"license":"MIT","name":"monacozen","peerDependencies":{"react":"^19.3.0","react-dom":"^19.3.0"},"repository":"github:Jaid/monacozen","version":"0.2.0","type":"module","exports":{".":{"types":"./lib.d.ts","import":"./lib.js","default":"./lib.js"}},"types":"./lib.d.ts"}
1
+ {"bugs":{"url":"https://github.com/Jaid/monacozen/issues"},"description":"text editor component with batteries included and UI clutter removed","homepage":"https://github.com/Jaid/monacozen#readme","keywords":["editor","monaco","react","text-editor"],"license":"MIT","name":"monacozen","peerDependencies":{"react":"^19.3.0","react-dom":"^19.3.0"},"repository":"github:Jaid/monacozen","version":"0.3.0","type":"module","exports":{".":{"types":"./lib.d.ts","import":"./lib.js","default":"./lib.js"}},"types":"./lib.d.ts"}
package/src/main.js CHANGED
@@ -10,16 +10,16 @@ return"antimono"!==a||i},p=({dark:e=!0,font:a="antimono",height:o="100%",width:t
10
10
  let y=i(null),C=i(u)
11
11
  n(f,()=>y.current,[]),r(()=>{y.current&&C.current?.(y.current)},[])
12
12
  let S=s("textarea",{...b,...void 0===g?{defaultValue:v}:{value:g},spellCheck:b.spellCheck??!1,style:{boxSizing:"border-box",display:"block",resize:"none",border:0,borderRadius:0,margin:0,padding:0,fontSize:14,lineHeight:"16px",tabSize:2,height:o,width:t,...m,backgroundColor:e?"#000":"#fff",color:e?"#fff":"#000",fontFamily:c[a].fontFamily},ref:y,onChange:e=>d?.(e.currentTarget.value,e)})
13
- return p?s("div",{...p,children:S}):S},g=o(async()=>{let[{Editor:e,loader:a},o]=await Promise.all([import("../assets/dist-Bx9hOuoB.js"),import("../assets/monaco-o5F6wkXp.js").then(e=>e.t)])
14
- return u=o.registerModelSchema,a.config({monaco:o.default}),{default:e}}),v=({dark:e=!0,font:o="antimono",height:n="100%",width:r="100%",schema:l,monaco:d,autoFocus:c,disabled:f,readOnly:p,placeholder:v,beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,keepCurrentModel:w,language:M,line:k,loading:V="Loading…",onChange:z,onMount:x,onValidate:F,overrideServices:O,path:L,saveViewState:E,value:D,wrapperProps:P,style:j,...H})=>{let R=h(o),A=i(l),B=i(null)
15
- t(()=>{R&&B.current?.monaco.editor.remeasureFonts()},[R,o]),t(()=>{A.current=l,B.current?.refreshSchema()},[l])
16
- let I=m(o,{...!0===d?{}:d,...void 0===p?{}:{readOnly:p},...f?{readOnly:!0,domReadOnly:!0}:{},...void 0===v?{}:{placeholder:v},...void 0===H["aria-label"]?{}:{ariaLabel:H["aria-label"]}})
17
- return s("div",{...P,...H,style:{...P?.style,width:r,height:n,...j},children:s(a,{fallback:V,children:s(g,{beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,height:"100%",keepCurrentModel:w,language:M,line:k,loading:V,options:I,overrideServices:O,path:L,saveViewState:E,theme:e?"vs-dark":"vs",value:D,width:"100%",onChange:z,onMount(e,a){let o,t=()=>{o?.dispose()
13
+ return p?s("div",{...p,children:S}):S},g=o(async()=>{let[{Editor:e,loader:a},o]=await Promise.all([import("../assets/dist-Bx9hOuoB.js"),import("../assets/monaco-DEq8WAj8.js").then(e=>e.t)])
14
+ return u=o.registerModelSchema,a.config({monaco:o.default}),{default:e}}),v=({dark:e=!0,font:o="antimono",height:n="100%",width:r="100%",schema:l,monaco:d,autoFocus:c,disabled:f,readOnly:p,placeholder:v,beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,keepCurrentModel:M,language:w,line:V,loading:k="Loading…",onChange:z,onMount:x,onValidate:F,overrideServices:O,path:E,saveViewState:L,value:D,wrapperProps:j,style:P,...A})=>{let H=h(o),R=i(l),B=i(null)
15
+ t(()=>{H&&B.current?.monaco.editor.remeasureFonts()},[H,o]),t(()=>{R.current=l,B.current?.refreshSchema()},[l])
16
+ let W=m(o,{...!0===d?{}:d,...void 0===p?{}:{readOnly:p},...f?{readOnly:!0,domReadOnly:!0}:{},...void 0===v?{}:{placeholder:v},...void 0===A["aria-label"]?{}:{ariaLabel:A["aria-label"]}})
17
+ return s("div",{...j,...A,style:{...j?.style,width:r,height:n,...P},children:s(a,{fallback:k,children:s(g,{beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,height:"100%",keepCurrentModel:M,language:w,line:V,loading:k,options:W,overrideServices:O,path:E,saveViewState:L,theme:e?"vs-dark":"vs",value:D,width:"100%",onChange:z,onMount(e,a){let o,t=()=>{o?.dispose()
18
18
  let a=e.getModel()
19
- o=a?u?.(a,A.current):void 0}
19
+ o=a?u?.(a,R.current):void 0}
20
20
  B.current={editor:e,monaco:a,refreshSchema:t},t()
21
21
  let n=e.onDidChangeModel(t),r=a.editor.onDidChangeModelLanguage(({model:a})=>{a===e.getModel()&&t()})
22
- R&&a.editor.remeasureFonts(),c&&e.focus()
22
+ H&&a.editor.remeasureFonts(),c&&e.focus()
23
23
  let i=e.onDidDispose(()=>{o?.dispose(),n.dispose(),r.dispose(),B.current?.editor===e&&(B.current=null),i.dispose()})
24
24
  x?.(e,a)},onValidate:F})})})}
25
25
  function b(a){let o,t,n=e(14),[r,i]=l(a.defaultValue??"")