@micacms/editor-ui 0.5.0-rc.1 → 0.5.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.
Files changed (53) hide show
  1. package/dist/assets/{ChangesView-CSjnT0fh.js → ChangesView-DVLSWguI.js} +2 -2
  2. package/dist/assets/{ChangesView-CSjnT0fh.js.map → ChangesView-DVLSWguI.js.map} +1 -1
  3. package/dist/assets/CollectionView-Dm0AZ-4T.js +2 -0
  4. package/dist/assets/CollectionView-Dm0AZ-4T.js.map +1 -0
  5. package/dist/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-BY6pag2U.js +2 -0
  6. package/dist/assets/{ConfirmDialog.vue_vue_type_script_setup_true_lang-C073kW3p.js.map → ConfirmDialog.vue_vue_type_script_setup_true_lang-BY6pag2U.js.map} +1 -1
  7. package/dist/assets/{DashboardView-BpelkVGe.js → DashboardView-DHf6CKvk.js} +2 -2
  8. package/dist/assets/{DashboardView-BpelkVGe.js.map → DashboardView-DHf6CKvk.js.map} +1 -1
  9. package/dist/assets/EntryView-DX4MCIIz.js +2 -0
  10. package/dist/assets/EntryView-DX4MCIIz.js.map +1 -0
  11. package/dist/assets/{LoginView-BmnX2zOD.js → LoginView-D3ztIdgO.js} +2 -2
  12. package/dist/assets/{LoginView-BmnX2zOD.js.map → LoginView-D3ztIdgO.js.map} +1 -1
  13. package/dist/assets/{MediaView-Dp2botAQ.js → MediaView-CeF4DCQR.js} +2 -2
  14. package/dist/assets/{MediaView-Dp2botAQ.js.map → MediaView-CeF4DCQR.js.map} +1 -1
  15. package/dist/assets/{NotFoundView-ByEOgkxm.js → NotFoundView-DvofX918.js} +2 -2
  16. package/dist/assets/{NotFoundView-ByEOgkxm.js.map → NotFoundView-DvofX918.js.map} +1 -1
  17. package/dist/assets/ObjectField--_IMDLHp.js +2 -0
  18. package/dist/assets/{ObjectField-BSITpnGH.js.map → ObjectField--_IMDLHp.js.map} +1 -1
  19. package/dist/assets/{PageHeader.vue_vue_type_script_setup_true_lang-DJWhe1Ye.js → PageHeader.vue_vue_type_script_setup_true_lang-Cr0v1G7O.js} +2 -2
  20. package/dist/assets/{PageHeader.vue_vue_type_script_setup_true_lang-DJWhe1Ye.js.map → PageHeader.vue_vue_type_script_setup_true_lang-Cr0v1G7O.js.map} +1 -1
  21. package/dist/assets/ReadOnlyNotice.vue_vue_type_script_setup_true_lang-BtfQSv1l.js +7 -0
  22. package/dist/assets/ReadOnlyNotice.vue_vue_type_script_setup_true_lang-BtfQSv1l.js.map +1 -0
  23. package/dist/assets/{RepeaterField-BnXDf3wL.js → RepeaterField-CRo8CLz6.js} +2 -2
  24. package/dist/assets/{RepeaterField-BnXDf3wL.js.map → RepeaterField-CRo8CLz6.js.map} +1 -1
  25. package/dist/assets/SingletonView-C1VhZ6Vv.js +2 -0
  26. package/dist/assets/SingletonView-C1VhZ6Vv.js.map +1 -0
  27. package/dist/assets/{SystemView-C6RAZvd2.js → SystemView-Bc2he_Af.js} +2 -2
  28. package/dist/assets/{SystemView-C6RAZvd2.js.map → SystemView-Bc2he_Af.js.map} +1 -1
  29. package/dist/assets/{arrow-right-DD5BWXHV.js → arrow-right-D8-sqdXS.js} +2 -2
  30. package/dist/assets/{arrow-right-DD5BWXHV.js.map → arrow-right-D8-sqdXS.js.map} +1 -1
  31. package/dist/assets/{arrow-up-Bdxg9_RJ.js → arrow-up-Bg3MuXmP.js} +2 -2
  32. package/dist/assets/{arrow-up-Bdxg9_RJ.js.map → arrow-up-Bg3MuXmP.js.map} +1 -1
  33. package/dist/assets/{chevron-down-CcJtiSTR.js → chevron-down-CnhoXsgY.js} +2 -2
  34. package/dist/assets/{chevron-down-CcJtiSTR.js.map → chevron-down-CnhoXsgY.js.map} +1 -1
  35. package/dist/assets/{index-BsOOwFCf.js → index-BHBq4-Io.js} +3 -3
  36. package/dist/assets/{index-BsOOwFCf.js.map → index-BHBq4-Io.js.map} +1 -1
  37. package/dist/assets/{useField-BxptRsz_.js → useField-vKkdSfn7.js} +2 -2
  38. package/dist/assets/{useField-BxptRsz_.js.map → useField-vKkdSfn7.js.map} +1 -1
  39. package/dist/assets/{useUnsavedChanges-FB5XcFfI.js → useUnsavedChanges-FKPfUHdo.js} +17 -17
  40. package/dist/assets/useUnsavedChanges-FKPfUHdo.js.map +1 -0
  41. package/dist/index.html +1 -1
  42. package/package.json +2 -2
  43. package/dist/assets/CollectionView-BlLAhVVi.js +0 -2
  44. package/dist/assets/CollectionView-BlLAhVVi.js.map +0 -1
  45. package/dist/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-C073kW3p.js +0 -2
  46. package/dist/assets/EntryView-DZuhqJnd.js +0 -2
  47. package/dist/assets/EntryView-DZuhqJnd.js.map +0 -1
  48. package/dist/assets/ObjectField-BSITpnGH.js +0 -2
  49. package/dist/assets/SingletonView-Cb8Qq_gr.js +0 -2
  50. package/dist/assets/SingletonView-Cb8Qq_gr.js.map +0 -1
  51. package/dist/assets/plus-CgaTSYYb.js +0 -7
  52. package/dist/assets/plus-CgaTSYYb.js.map +0 -1
  53. package/dist/assets/useUnsavedChanges-FB5XcFfI.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{g as l}from"./index-BsOOwFCf.js";let f=0;function g(e){const n=`field-${++f}`,s=`${n}-hint`,o=`${n}-error`,i=l(()=>e.field.label??p(h(e.path))),r=l(()=>{var a;const t=(a=e.issues)==null?void 0:a.find(d=>d.path===e.path);return(t==null?void 0:t.message)??null}),u=l(()=>{const t=[e.field.description?s:null,r.value?o:null].filter(Boolean);return t.length>0?t.join(" "):void 0});return{inputId:n,label:i,error:r,describedBy:u,hintId:s,errorId:o}}function h(e){return e.split(".").at(-1)??e}function p(e){const n=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ");return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()}const c={full:"col-span-12",half:"col-span-12 sm:col-span-6",third:"col-span-12 sm:col-span-4"};function $(e){return c[e.width??"full"]??c.full}export{p as h,g as u,$ as w};
2
- //# sourceMappingURL=useField-BxptRsz_.js.map
1
+ import{g as l}from"./index-BHBq4-Io.js";let f=0;function g(e){const n=`field-${++f}`,s=`${n}-hint`,o=`${n}-error`,i=l(()=>e.field.label??p(h(e.path))),r=l(()=>{var a;const t=(a=e.issues)==null?void 0:a.find(d=>d.path===e.path);return(t==null?void 0:t.message)??null}),u=l(()=>{const t=[e.field.description?s:null,r.value?o:null].filter(Boolean);return t.length>0?t.join(" "):void 0});return{inputId:n,label:i,error:r,describedBy:u,hintId:s,errorId:o}}function h(e){return e.split(".").at(-1)??e}function p(e){const n=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ");return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()}const c={full:"col-span-12",half:"col-span-12 sm:col-span-6",third:"col-span-12 sm:col-span-4"};function $(e){return c[e.width??"full"]??c.full}export{p as h,g as u,$ as w};
2
+ //# sourceMappingURL=useField-vKkdSfn7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useField-BxptRsz_.js","sources":["../../src/composables/useField.ts"],"sourcesContent":["/**\n * Shared plumbing for every field component: a stable input id, the label to\n * show, and the server-side issue that belongs to this exact path.\n */\n\nimport { computed, type ComputedRef } from \"vue\";\n\nimport type { AnyField, FieldIssue } from \"@micacms/core\";\n\nlet sequence = 0;\n\nexport interface FieldProps {\n field: AnyField;\n /** Dotted path, e.g. `seo.metaTitle` or `facts.2.label`. */\n path: string;\n /** Flat issue list for the whole form; each field picks out its own. */\n issues?: FieldIssue[];\n disabled?: boolean;\n}\n\nexport interface UseField {\n inputId: string;\n label: ComputedRef<string>;\n error: ComputedRef<string | null>;\n describedBy: ComputedRef<string | undefined>;\n hintId: string;\n errorId: string;\n}\n\nexport function useField(props: FieldProps): UseField {\n const inputId = `field-${++sequence}`;\n const hintId = `${inputId}-hint`;\n const errorId = `${inputId}-error`;\n\n const label = computed(() => props.field.label ?? humanise(lastSegment(props.path)));\n\n const error = computed(() => {\n const match = props.issues?.find((issue) => issue.path === props.path);\n return match?.message ?? null;\n });\n\n const describedBy = computed(() => {\n const parts = [props.field.description ? hintId : null, error.value ? errorId : null].filter(\n Boolean,\n );\n return parts.length > 0 ? parts.join(\" \") : undefined;\n });\n\n return { inputId, label, error, describedBy, hintId, errorId };\n}\n\nfunction lastSegment(path: string): string {\n return path.split(\".\").at(-1) ?? path;\n}\n\n/** `metaTitle` → `Meta title`, used when a field declares no label. */\nexport function humanise(key: string): string {\n const spaced = key.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\").replace(/[_-]+/g, \" \");\n return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();\n}\n\nconst WIDTHS: Record<string, string> = {\n full: \"col-span-12\",\n half: \"col-span-12 sm:col-span-6\",\n third: \"col-span-12 sm:col-span-4\",\n};\n\nexport function widthClass(field: AnyField): string {\n return WIDTHS[field.width ?? \"full\"] ?? WIDTHS.full!;\n}\n"],"names":["sequence","useField","props","inputId","hintId","errorId","label","computed","humanise","lastSegment","error","match","_a","issue","describedBy","parts","path","key","spaced","WIDTHS","widthClass","field"],"mappings":"wCASA,IAAIA,EAAW,EAoBR,SAASC,EAASC,EAA6B,CACpD,MAAMC,EAAU,SAAS,EAAEH,CAAQ,GAC7BI,EAAS,GAAGD,CAAO,QACnBE,EAAU,GAAGF,CAAO,SAEpBG,EAAQC,EAAS,IAAML,EAAM,MAAM,OAASM,EAASC,EAAYP,EAAM,IAAI,CAAC,CAAC,EAE7EQ,EAAQH,EAAS,IAAM,OAC3B,MAAMI,GAAQC,EAAAV,EAAM,SAAN,YAAAU,EAAc,KAAMC,GAAUA,EAAM,OAASX,EAAM,MACjE,OAAOS,GAAA,YAAAA,EAAO,UAAW,IAC3B,CAAC,EAEKG,EAAcP,EAAS,IAAM,CACjC,MAAMQ,EAAQ,CAACb,EAAM,MAAM,YAAcE,EAAS,KAAMM,EAAM,MAAQL,EAAU,IAAI,EAAE,OACpF,OAAA,EAEF,OAAOU,EAAM,OAAS,EAAIA,EAAM,KAAK,GAAG,EAAI,MAC9C,CAAC,EAED,MAAO,CAAE,QAAAZ,EAAS,MAAAG,EAAO,MAAAI,EAAO,YAAAI,EAAa,OAAAV,EAAQ,QAAAC,CAAA,CACvD,CAEA,SAASI,EAAYO,EAAsB,CACzC,OAAOA,EAAK,MAAM,GAAG,EAAE,GAAG,EAAE,GAAKA,CACnC,CAGO,SAASR,EAASS,EAAqB,CAC5C,MAAMC,EAASD,EAAI,QAAQ,qBAAsB,OAAO,EAAE,QAAQ,SAAU,GAAG,EAC/E,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAgBA,EAAO,MAAM,CAAC,EAAE,YAAA,CAC1D,CAEA,MAAMC,EAAiC,CACrC,KAAM,cACN,KAAM,4BACN,MAAO,2BACT,EAEO,SAASC,EAAWC,EAAyB,CAClD,OAAOF,EAAOE,EAAM,OAAS,MAAM,GAAKF,EAAO,IACjD"}
1
+ {"version":3,"file":"useField-vKkdSfn7.js","sources":["../../src/composables/useField.ts"],"sourcesContent":["/**\n * Shared plumbing for every field component: a stable input id, the label to\n * show, and the server-side issue that belongs to this exact path.\n */\n\nimport { computed, type ComputedRef } from \"vue\";\n\nimport type { AnyField, FieldIssue } from \"@micacms/core\";\n\nlet sequence = 0;\n\nexport interface FieldProps {\n field: AnyField;\n /** Dotted path, e.g. `seo.metaTitle` or `facts.2.label`. */\n path: string;\n /** Flat issue list for the whole form; each field picks out its own. */\n issues?: FieldIssue[];\n disabled?: boolean;\n}\n\nexport interface UseField {\n inputId: string;\n label: ComputedRef<string>;\n error: ComputedRef<string | null>;\n describedBy: ComputedRef<string | undefined>;\n hintId: string;\n errorId: string;\n}\n\nexport function useField(props: FieldProps): UseField {\n const inputId = `field-${++sequence}`;\n const hintId = `${inputId}-hint`;\n const errorId = `${inputId}-error`;\n\n const label = computed(() => props.field.label ?? humanise(lastSegment(props.path)));\n\n const error = computed(() => {\n const match = props.issues?.find((issue) => issue.path === props.path);\n return match?.message ?? null;\n });\n\n const describedBy = computed(() => {\n const parts = [props.field.description ? hintId : null, error.value ? errorId : null].filter(\n Boolean,\n );\n return parts.length > 0 ? parts.join(\" \") : undefined;\n });\n\n return { inputId, label, error, describedBy, hintId, errorId };\n}\n\nfunction lastSegment(path: string): string {\n return path.split(\".\").at(-1) ?? path;\n}\n\n/** `metaTitle` → `Meta title`, used when a field declares no label. */\nexport function humanise(key: string): string {\n const spaced = key.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\").replace(/[_-]+/g, \" \");\n return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();\n}\n\nconst WIDTHS: Record<string, string> = {\n full: \"col-span-12\",\n half: \"col-span-12 sm:col-span-6\",\n third: \"col-span-12 sm:col-span-4\",\n};\n\nexport function widthClass(field: AnyField): string {\n return WIDTHS[field.width ?? \"full\"] ?? WIDTHS.full!;\n}\n"],"names":["sequence","useField","props","inputId","hintId","errorId","label","computed","humanise","lastSegment","error","match","_a","issue","describedBy","parts","path","key","spaced","WIDTHS","widthClass","field"],"mappings":"wCASA,IAAIA,EAAW,EAoBR,SAASC,EAASC,EAA6B,CACpD,MAAMC,EAAU,SAAS,EAAEH,CAAQ,GAC7BI,EAAS,GAAGD,CAAO,QACnBE,EAAU,GAAGF,CAAO,SAEpBG,EAAQC,EAAS,IAAML,EAAM,MAAM,OAASM,EAASC,EAAYP,EAAM,IAAI,CAAC,CAAC,EAE7EQ,EAAQH,EAAS,IAAM,OAC3B,MAAMI,GAAQC,EAAAV,EAAM,SAAN,YAAAU,EAAc,KAAMC,GAAUA,EAAM,OAASX,EAAM,MACjE,OAAOS,GAAA,YAAAA,EAAO,UAAW,IAC3B,CAAC,EAEKG,EAAcP,EAAS,IAAM,CACjC,MAAMQ,EAAQ,CAACb,EAAM,MAAM,YAAcE,EAAS,KAAMM,EAAM,MAAQL,EAAU,IAAI,EAAE,OACpF,OAAA,EAEF,OAAOU,EAAM,OAAS,EAAIA,EAAM,KAAK,GAAG,EAAI,MAC9C,CAAC,EAED,MAAO,CAAE,QAAAZ,EAAS,MAAAG,EAAO,MAAAI,EAAO,YAAAI,EAAa,OAAAV,EAAQ,QAAAC,CAAA,CACvD,CAEA,SAASI,EAAYO,EAAsB,CACzC,OAAOA,EAAK,MAAM,GAAG,EAAE,GAAG,EAAE,GAAKA,CACnC,CAGO,SAASR,EAASS,EAAqB,CAC5C,MAAMC,EAASD,EAAI,QAAQ,qBAAsB,OAAO,EAAE,QAAQ,SAAU,GAAG,EAC/E,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAgBA,EAAO,MAAM,CAAC,EAAE,YAAA,CAC1D,CAEA,MAAMC,EAAiC,CACrC,KAAM,cACN,KAAM,4BACN,MAAO,2BACT,EAEO,SAASC,EAAWC,EAAyB,CAClD,OAAOF,EAAOE,EAAM,OAAS,MAAM,GAAKF,EAAO,IACjD"}