@oktis-works/admin 0.12.0 → 0.14.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 (114) hide show
  1. package/dist/client/_astro/{ActivityWidget.D9s4FOLp.js → ActivityWidget.DmhtX3Xm.js} +2 -2
  2. package/dist/client/_astro/{AdminBar.D8078Gqs.js → AdminBar.DKoQ5M3w.js} +2 -2
  3. package/dist/client/_astro/ApiKeysManager.BaPrAyqm.js +1 -0
  4. package/dist/client/_astro/{AtGlanceWidget.DBA3mEnF.js → AtGlanceWidget.zlWIhmzI.js} +3 -3
  5. package/dist/client/_astro/{BaseLayout.DAkzjMTq.css → BaseLayout.Cp-O10m_.css} +1 -1
  6. package/dist/client/_astro/CommentsManager.DROGQRli.js +21 -0
  7. package/dist/client/_astro/ContentEditor.ChA5r0aE.js +3 -0
  8. package/dist/client/_astro/ContentEditor.CtCFQb14.js +1 -0
  9. package/dist/client/_astro/ContentTypeWorkspace.Dj9dP14a.js +1 -0
  10. package/dist/client/_astro/DashboardHome.Dn6_pJuX.js +1 -0
  11. package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.Cc0PvXrs.js → DashboardLayout.astro_astro_type_script_index_0_lang.NiobGnWg.js} +1 -1
  12. package/dist/client/_astro/FbIcon.Bn4e_qFb.js +1 -0
  13. package/dist/client/_astro/FieldGroupEditor.CiFoYYb2.js +69 -0
  14. package/dist/client/_astro/FieldGroupList.CdN99hvU.js +1 -0
  15. package/dist/client/_astro/FieldRenderer.DYMREsip.js +1 -0
  16. package/dist/client/_astro/FloatingPanel.BetdW5N2.js +1 -0
  17. package/dist/client/_astro/{Footer.Chcu8yzV.js → Footer.VGpnxqkW.js} +2 -2
  18. package/dist/client/_astro/GeneralSettings.mQ7FyhM-.js +1 -0
  19. package/dist/client/_astro/LogsManager.BUJ7baOa.js +1 -0
  20. package/dist/client/_astro/MediaLibrary.DMvI8KXX.js +1 -0
  21. package/dist/client/_astro/MenuManager._4YgarRt.js +1 -0
  22. package/dist/client/_astro/Modal.DbBPpkbR.js +1 -0
  23. package/dist/client/_astro/{PluginManager.BHvKQlj2.js → PluginManager.BozI4gXB.js} +2 -2
  24. package/dist/client/_astro/PostTypesManager.CifIQbeV.js +1 -0
  25. package/dist/client/_astro/QuickDraftWidget.CsG3_wS2.js +17 -0
  26. package/dist/client/_astro/ResourceHubs.DedTFbiz.js +1 -0
  27. package/dist/client/_astro/TaxonomiesManager.JqBPU1pf.js +1 -0
  28. package/dist/client/_astro/TaxonomyTermsManager.BLGRLt8p.js +1 -0
  29. package/dist/client/_astro/ThemeCustomizer.DrSQPj4W.js +49 -0
  30. package/dist/client/_astro/{ThemeManager.DuHgcKyn.js → ThemeManager.Csu39Xjr.js} +2 -2
  31. package/dist/client/_astro/UserCreateForm.C54wZYbf.js +1 -0
  32. package/dist/client/_astro/UsersManager.BYTWz2I8.js +1 -0
  33. package/dist/client/_astro/WebhooksManager.DeJ_f1Gk.js +1 -0
  34. package/dist/client/_astro/{api.CYg1SW2X.js → api.flUgn70U.js} +1 -1
  35. package/dist/client/_astro/client.ljtU74WL.js +1 -0
  36. package/dist/client/_astro/extensions.DtuT3Phu.js +1 -0
  37. package/dist/client/_astro/i18n.CBexpqud.js +1 -0
  38. package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.F2J3xZhK.js → login.astro_astro_type_script_index_0_lang.COYjmQTY.js} +1 -1
  39. package/dist/client/_astro/preload-helper.oCYlU9a4.js +1 -0
  40. package/dist/client/_astro/pt-BR.DlIhl4_A.js +1 -0
  41. package/dist/client/_astro/solid.Ck4Vtfe4.js +1 -0
  42. package/dist/client/_astro/src.CYKGYEyR.js +1 -0
  43. package/dist/client/_astro/store.CYzqtRKs.js +1 -0
  44. package/dist/client/_astro/web.DD6VKaIp.js +1 -0
  45. package/dist/server/chunks/{404_C9d1fN7T.mjs → 404_BxFvEXYq.mjs} +1 -1
  46. package/dist/server/chunks/{BaseLayout_D-10OcWZ.mjs → BaseLayout_BTzlA_Yr.mjs} +5 -5
  47. package/dist/server/chunks/ContentEditor_DStZ4RZE.mjs +655 -0
  48. package/dist/server/chunks/{DashboardLayout_HxBoC5fJ.mjs → DashboardLayout_PXoRmnBH.mjs} +362 -99
  49. package/dist/server/chunks/{FbIcon_D0f6QiFJ.mjs → FbIcon_7YixzwO3.mjs} +1 -1
  50. package/dist/server/chunks/{ContentEditor_DZWLWgAD.mjs → FieldRenderer_BlZgS0Im.mjs} +159 -588
  51. package/dist/server/chunks/{FloatingPanel_DI2CdUZK.mjs → FloatingPanel_BtB-nNBT.mjs} +1 -1
  52. package/dist/server/chunks/{MediaLibrary_CD_cadEt.mjs → MediaLibrary_D7vu5VMd.mjs} +3 -3
  53. package/dist/server/chunks/{Modal_vHjkS4i2.mjs → Modal_I_mBEOz2.mjs} +2 -2
  54. package/dist/server/chunks/{PageHeader_CBOioOjo.mjs → PageHeader_CRpzf5xU.mjs} +1 -1
  55. package/dist/server/chunks/{_id__DrGJOSWh.mjs → _id__DFFoFesR.mjs} +209 -66
  56. package/dist/server/chunks/{_slug__C6TfwYcI.mjs → _slug__DBH2w1la.mjs} +2 -2
  57. package/dist/server/chunks/{access_D46Rg5g2.mjs → access_D1rk89Sh.mjs} +8 -8
  58. package/dist/server/chunks/{api-keys_BUCeuDw4.mjs → api-keys_BqhmvOer.mjs} +6 -6
  59. package/dist/server/chunks/comments_D_ta2fip.mjs +208 -0
  60. package/dist/server/chunks/{custom-fields_B7PeZo06.mjs → custom-fields_Cl8P-rrK.mjs} +5 -5
  61. package/dist/server/chunks/customize_DgtzmFmz.mjs +233 -0
  62. package/dist/server/chunks/{edit_H_Z0tUXd.mjs → edit_DTk4qFj5.mjs} +3 -3
  63. package/dist/server/chunks/{general_BROn356D.mjs → general_B-fEXuQn.mjs} +7 -7
  64. package/dist/server/chunks/{i18n_CItvcX64.mjs → i18n_BmAxDr2Q.mjs} +76 -10
  65. package/dist/server/chunks/{index_BYjGHhFv.mjs → index_BKjRvOw4.mjs} +113 -64
  66. package/dist/server/chunks/{index_BSanLOwq.mjs → index_BXnSMGRk.mjs} +4 -4
  67. package/dist/server/chunks/{index_9wINU7Wu.mjs → index_BcVtYp1L.mjs} +5 -5
  68. package/dist/server/chunks/{index_WgopTFB2.mjs → index_DI8jAAVQ.mjs} +2 -2
  69. package/dist/server/chunks/{index_GXbAk6jt.mjs → index_DXsKda1J.mjs} +4 -4
  70. package/dist/server/chunks/{login_BzHv0uQ0.mjs → login_BGPEB2l4.mjs} +1 -1
  71. package/dist/server/chunks/{logs_C32euU-n.mjs → logs_XjDk7dqi.mjs} +5 -5
  72. package/dist/server/chunks/{menus_EJ0NIw-1.mjs → menus_Kqym4CNK.mjs} +4 -4
  73. package/dist/server/chunks/{new_CWKqh8oV.mjs → new_BiikYmvu.mjs} +5 -5
  74. package/dist/server/chunks/{new_BwrgYLev.mjs → new_Dnp7PIHP.mjs} +3 -3
  75. package/dist/server/chunks/{plugins_C8RXEzie.mjs → plugins_C6qX0SAE.mjs} +5 -5
  76. package/dist/server/chunks/{post-types_bDF0xDxo.mjs → post-types_Dr4t-TYB.mjs} +7 -7
  77. package/dist/server/chunks/{pt-BR_DpWzkRv5.mjs → pt-BR_DH_fNjEo.mjs} +49 -5
  78. package/dist/server/chunks/{taxonomies_AHnU1mD0.mjs → taxonomies_B0YzIdmD.mjs} +5 -5
  79. package/dist/server/chunks/{taxonomy_DwH2xYGw.mjs → taxonomy_CCWZ58qQ.mjs} +63 -18
  80. package/dist/server/chunks/{themes_DE_yoCn2.mjs → themes_C7G3LcIz.mjs} +5 -5
  81. package/dist/server/chunks/{upload_BQA9bixd.mjs → upload_BT3ud_vb.mjs} +4 -4
  82. package/dist/server/chunks/{webhooks_iWH_jV-x.mjs → webhooks_CWW0L8EK.mjs} +5 -5
  83. package/dist/server/entry.mjs +104 -50
  84. package/dist/server/virtual_astro_middleware.mjs +3 -3
  85. package/package.json +5 -5
  86. package/dist/client/_astro/ApiKeysManager.BjyxI6JT.js +0 -1
  87. package/dist/client/_astro/ContentEditor.BZ8aLcGz.js +0 -3
  88. package/dist/client/_astro/ContentEditor.CfQqsa6r.js +0 -1
  89. package/dist/client/_astro/ContentTypeWorkspace.BhHFc6WZ.js +0 -1
  90. package/dist/client/_astro/DashboardHome.BXIUgb4u.js +0 -1
  91. package/dist/client/_astro/FbIcon.CUNS6rpP.js +0 -1
  92. package/dist/client/_astro/FieldGroupEditor.CVoPJ2v-.js +0 -69
  93. package/dist/client/_astro/FieldGroupList.BG2ET5gZ.js +0 -1
  94. package/dist/client/_astro/FloatingPanel.BeCEt_JP.js +0 -1
  95. package/dist/client/_astro/GeneralSettings.CefkBcVj.js +0 -1
  96. package/dist/client/_astro/LogsManager.ya0kmAUm.js +0 -1
  97. package/dist/client/_astro/MediaLibrary.Bod2Afk4.js +0 -1
  98. package/dist/client/_astro/MenuManager.d6_0hgNg.js +0 -1
  99. package/dist/client/_astro/Modal.DR905gyF.js +0 -1
  100. package/dist/client/_astro/PostTypesManager.DMUxfOp9.js +0 -1
  101. package/dist/client/_astro/QuickDraftWidget.DyX_bJ1p.js +0 -17
  102. package/dist/client/_astro/ResourceHubs.BwxYHeE5.js +0 -1
  103. package/dist/client/_astro/TaxonomiesManager.DlVS4Ujm.js +0 -1
  104. package/dist/client/_astro/TaxonomyTermsManager.B_ZDFU-K.js +0 -1
  105. package/dist/client/_astro/UserCreateForm.1KIa3Aa2.js +0 -1
  106. package/dist/client/_astro/UsersManager.v24y8OSk.js +0 -1
  107. package/dist/client/_astro/WebhooksManager.DPkFhoVr.js +0 -1
  108. package/dist/client/_astro/client.DU9Dc2oe.js +0 -1
  109. package/dist/client/_astro/extensions.Brl6zAPA.js +0 -1
  110. package/dist/client/_astro/i18n.AbBpo2WD.js +0 -1
  111. package/dist/client/_astro/pt-BR.B0jeLTb0.js +0 -1
  112. package/dist/client/_astro/solid.D49dPDCT.js +0 -1
  113. package/dist/client/_astro/src.DXVWCoHp.js +0 -1
  114. package/dist/client/_astro/web.Bqbl_1YR.js +0 -1
@@ -1,5 +1,5 @@
1
- import { n as useTranslation, r as apiClient } from "./i18n_CItvcX64.mjs";
2
- import { a as For2, f as createMemo$1, p as createSignal$1, u as Show2 } from "./DashboardLayout_HxBoC5fJ.mjs";
1
+ import "./i18n_BmAxDr2Q.mjs";
2
+ import { _ as createMemo$1, h as Show2, u as For2, v as createSignal$1 } from "./DashboardLayout_PXoRmnBH.mjs";
3
3
  import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
4
4
  import { For, Show, createMemo, createSignal, onMount } from "solid-js";
5
5
  //#region ../../packages/validation/dist/client-validate.js
@@ -525,313 +525,7 @@ function expandCloneFields(fields) {
525
525
  return result;
526
526
  }
527
527
  //#endregion
528
- //#region src/lib/sanitize.ts
529
- /**
530
- * Sanitizador de HTML em allowlist para pontos de injeção (innerHTML).
531
- *
532
- * O admin injeta HTML apenas no conteúdo das abas de ajuda (HelpTabs), que
533
- * vem do i18n — mas todo innerHTML passa por aqui por defesa em profundidade.
534
- *
535
- * Garantias:
536
- * - Allowlist de tags e atributos (script/style/svg/iframe/form são removidos,
537
- * incluindo o conteúdo de tags de texto bruto como <script> e <style>).
538
- * - Atributos de evento (on*), style e demais fora da allowlist são descartados.
539
- * - href/src têm o protocolo validado DEPOIS de decodificar entidades e remover
540
- * tab/newline — o valor emitido é re-escapado a partir do valor decodificado,
541
- * de modo que o que o navegador decodifica é exatamente o que foi validado
542
- * (bloqueia `javascript:`, `&#106;avascript:`, `javascript&colon;`, etc).
543
- * - Texto é escapado (& < >), preservando entidades já válidas.
544
- * - Tags de fechamento sem âncora são ignoradas: conteúdo malicioso não consegue
545
- * "escapar" do container nem desbalancear a árvore (o quebra-cabeça de abas
546
- * e widgets continua íntegro).
547
- *
548
- * Puro JavaScript, sem APIs de DOM: roda igual no SSR (Node) e no navegador.
549
- */
550
- /** Tags permitidas (conteúdo rico simples: ajuda, títulos, listas, links). */
551
- var ALLOWED_TAGS = /* @__PURE__ */ new Set([
552
- "a",
553
- "abbr",
554
- "b",
555
- "blockquote",
556
- "br",
557
- "code",
558
- "dd",
559
- "div",
560
- "dl",
561
- "dt",
562
- "em",
563
- "figcaption",
564
- "figure",
565
- "h1",
566
- "h2",
567
- "h3",
568
- "h4",
569
- "h5",
570
- "h6",
571
- "hr",
572
- "i",
573
- "img",
574
- "li",
575
- "ol",
576
- "p",
577
- "pre",
578
- "q",
579
- "s",
580
- "span",
581
- "strong",
582
- "sub",
583
- "sup",
584
- "u",
585
- "ul"
586
- ]);
587
- /** Tags vazias (emitidas com fechamento próprio, nunca empilhadas). */
588
- var VOID_TAGS = /* @__PURE__ */ new Set([
589
- "br",
590
- "hr",
591
- "img"
592
- ]);
593
- /**
594
- * Tags cujo conteúdo é texto bruto no HTML. Ao encontrá-las abertas, todo o
595
- * miolo é descartado até o fechamento correspondente (senão, o conteúdo do
596
- * <script> viraria texto visível ou vetor de parse).
597
- */
598
- var RAW_TEXT_TAGS = /* @__PURE__ */ new Set([
599
- "script",
600
- "style",
601
- "iframe",
602
- "object",
603
- "embed",
604
- "svg",
605
- "math",
606
- "textarea",
607
- "title",
608
- "noscript",
609
- "template"
610
- ]);
611
- /** Atributos permitidos (globais; validação extra por atributo abaixo). */
612
- var ALLOWED_ATTRS = /* @__PURE__ */ new Set([
613
- "class",
614
- "title",
615
- "alt",
616
- "width",
617
- "height",
618
- "href",
619
- "src",
620
- "target",
621
- "rel"
622
- ]);
623
- /** Esquemas aceitos em href (links externos, e-mail, telefone). */
624
- var HREF_SCHEMES = /* @__PURE__ */ new Set([
625
- "http",
626
- "https",
627
- "mailto",
628
- "tel"
629
- ]);
630
- /** Esquemas aceitos em src (somente rede). */
631
- var SRC_SCHEMES = /* @__PURE__ */ new Set(["http", "https"]);
632
- /** Entidades nomeadas relevantes (as que poderiam alterar a validação de URL). */
633
- var NAMED_ENTITIES = {
634
- amp: "&",
635
- lt: "<",
636
- gt: ">",
637
- quot: "\"",
638
- apos: "'",
639
- colon: ":",
640
- tab: " ",
641
- newline: "\n",
642
- sol: "/",
643
- lpar: "(",
644
- rpar: ")",
645
- num: "#",
646
- period: ".",
647
- excl: "!",
648
- comma: ","
649
- };
650
- /** Decodifica referências numéricas e nomeadas (uma passada, como o navegador). */
651
- function decodeEntities(value) {
652
- return value.replace(/&#x([0-9a-fA-F]+);?/g, (_m, hex) => fromCodePoint(parseInt(hex, 16))).replace(/&#(\d+);?/g, (_m, dec) => fromCodePoint(parseInt(dec, 10))).replace(/&([a-zA-Z][a-zA-Z0-9]{1,30});?/g, (m, name) => {
653
- return NAMED_ENTITIES[name in NAMED_ENTITIES ? name : name.toLowerCase()] ?? m;
654
- });
655
- }
656
- function fromCodePoint(cp) {
657
- if (!Number.isFinite(cp) || cp < 0 || cp > 1114111) return "";
658
- try {
659
- return String.fromCodePoint(cp);
660
- } catch {
661
- return "";
662
- }
663
- }
664
- /** Escapa valor para uso dentro de atributo entre aspas duplas. */
665
- function escapeAttr(value) {
666
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
667
- }
668
- /**
669
- * Escapa texto preservando entidades já válidas (evita exibir `&amp;`
670
- * literalmente quando a tradução usa `&amp;` de propósito).
671
- */
672
- function escapeText(text) {
673
- return text.replace(/&(?![a-zA-Z][a-zA-Z0-9]{1,30};|#[0-9]{1,7};|#[xX][0-9a-fA-F]{1,6};)|[<>]/g, (m) => m === "&" ? "&amp;" : m === "<" ? "&lt;" : "&gt;");
674
- }
675
- /**
676
- * Valida URL decodificando entidades e removendo tab/newline (mesmo tratamento
677
- * do parser de URL do navegador) antes de inspecionar o esquema.
678
- */
679
- function isSafeUrl(raw, allowedSchemes) {
680
- const decoded = decodeEntities(raw).replace(/[\t\n\r]/g, "").trim();
681
- const scheme = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(decoded);
682
- if (!scheme) return true;
683
- return allowedSchemes.has(scheme[1].toLowerCase());
684
- }
685
- /** Normaliza valor de atributo: decodifica (como o navegador faria) e re-escapa. */
686
- function normalizeAttrValue(raw) {
687
- return escapeAttr(decodeEntities(raw));
688
- }
689
- /**
690
- * Extrai pares nome/valor de uma tag, respeitando aspas (um `>` dentro de
691
- * aspas não termina a tag) e valores não-aspados do HTML.
692
- */
693
- function parseAttrs(body) {
694
- const pairs = [];
695
- const n = body.length;
696
- let i = 0;
697
- const isWs = (c) => c === " " || c === " " || c === "\n" || c === "\r" || c === "\f";
698
- while (i < n) {
699
- while (i < n && (isWs(body.charAt(i)) || body.charAt(i) === "/")) i++;
700
- if (i >= n) break;
701
- let name = "";
702
- while (i < n && !isWs(body.charAt(i)) && body.charAt(i) !== "=" && body.charAt(i) !== ">" && body.charAt(i) !== "/" && body.charAt(i) !== "<") {
703
- name += body.charAt(i);
704
- i++;
705
- }
706
- if (!name) {
707
- i++;
708
- continue;
709
- }
710
- let value = "";
711
- let j = i;
712
- while (j < n && isWs(body.charAt(j))) j++;
713
- if (j < n && body.charAt(j) === "=") {
714
- j++;
715
- while (j < n && isWs(body.charAt(j))) j++;
716
- if (j < n && (body.charAt(j) === "\"" || body.charAt(j) === "'")) {
717
- const quote = body.charAt(j);
718
- j++;
719
- const start = j;
720
- while (j < n && body.charAt(j) !== quote) j++;
721
- value = body.slice(start, j);
722
- j++;
723
- } else {
724
- const start = j;
725
- while (j < n && !isWs(body.charAt(j)) && body.charAt(j) !== ">") j++;
726
- value = body.slice(start, j);
727
- }
728
- i = j;
729
- }
730
- pairs.push([name.toLowerCase(), value]);
731
- }
732
- return pairs;
733
- }
734
- /** Filtra atributos: allowlist + validação de protocolo; força rel seguro. */
735
- function filterAttrs(tag, pairs) {
736
- const kept = [];
737
- const seen = /* @__PURE__ */ new Set();
738
- let targetBlank = false;
739
- for (const [name, raw] of pairs) {
740
- if (!ALLOWED_ATTRS.has(name) || seen.has(name)) continue;
741
- if (name === "href" && !isSafeUrl(raw, HREF_SCHEMES)) continue;
742
- if (name === "src" && !isSafeUrl(raw, SRC_SCHEMES)) continue;
743
- if (name === "target") {
744
- if (normalizeAttrValue(raw) !== "_blank") continue;
745
- targetBlank = true;
746
- continue;
747
- }
748
- if (name === "rel") continue;
749
- seen.add(name);
750
- kept.push(`${name}="${normalizeAttrValue(raw)}"`);
751
- }
752
- if (tag === "a" && targetBlank) {
753
- kept.push("target=\"_blank\"");
754
- kept.push("rel=\"noopener noreferrer\"");
755
- }
756
- return kept.length > 0 ? ` ${kept.join(" ")}` : "";
757
- }
758
- /**
759
- * Sanitiza uma string de HTML. Retorna apenas marcação da allowlist.
760
- * Idempotente e sem dependências de DOM (seguro no SSR e no cliente).
761
- */
762
- function sanitizeHtml(input) {
763
- if (typeof input !== "string" || input.length === 0) return "";
764
- const lower = input.toLowerCase();
765
- const n = input.length;
766
- const stack = [];
767
- let out = "";
768
- let i = 0;
769
- while (i < n) {
770
- const lt = input.indexOf("<", i);
771
- if (lt === -1) {
772
- out += escapeText(input.slice(i));
773
- break;
774
- }
775
- if (lt > i) out += escapeText(input.slice(i, lt));
776
- if (input.startsWith("<!--", lt)) {
777
- const end = input.indexOf("-->", lt + 4);
778
- i = end === -1 ? n : end + 3;
779
- continue;
780
- }
781
- if (input.charAt(lt + 1) === "!" || input.charAt(lt + 1) === "?") {
782
- const end = input.indexOf(">", lt + 2);
783
- i = end === -1 ? n : end + 1;
784
- continue;
785
- }
786
- const tagMatch = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)(?=[\s/>])/.exec(input.slice(lt, Math.min(lt + 64, n)));
787
- if (!tagMatch) {
788
- out += "&lt;";
789
- i = lt + 1;
790
- continue;
791
- }
792
- const isClosing = tagMatch[1] === "/";
793
- const tag = tagMatch[2].toLowerCase();
794
- let j = lt + tagMatch[0].length;
795
- let quote = "";
796
- while (j < n) {
797
- const ch = input[j];
798
- if (quote) {
799
- if (ch === quote) quote = "";
800
- } else if (ch === "\"" || ch === "'") quote = ch;
801
- else if (ch === ">") break;
802
- j++;
803
- }
804
- if (j >= n) break;
805
- const body = input.slice(lt + tagMatch[0].length, j);
806
- i = j + 1;
807
- if (!isClosing && RAW_TEXT_TAGS.has(tag)) {
808
- const closeAt = lower.indexOf(`</${tag}`, i);
809
- if (closeAt === -1) break;
810
- const closeEnd = input.indexOf(">", closeAt);
811
- i = closeEnd === -1 ? n : closeEnd + 1;
812
- continue;
813
- }
814
- if (isClosing) {
815
- const anchor = stack.lastIndexOf(tag);
816
- if (anchor !== -1) {
817
- for (let k = stack.length - 1; k >= anchor; k--) out += `</${stack[k]}>`;
818
- stack.length = anchor;
819
- }
820
- continue;
821
- }
822
- if (!ALLOWED_TAGS.has(tag)) continue;
823
- const attrs = filterAttrs(tag, parseAttrs(body));
824
- if (VOID_TAGS.has(tag)) out += `<${tag}${attrs} />`;
825
- else {
826
- out += `<${tag}${attrs}>`;
827
- stack.push(tag);
828
- }
829
- }
830
- for (let k = stack.length - 1; k >= 0; k--) out += `</${stack[k]}>`;
831
- return out;
832
- }
833
- //#endregion
834
- //#region src/components/content/RelationshipPicker.tsx
528
+ //#region src/components/content/RelationshipPicker.jsx
835
529
  var _tmpl$$2 = [
836
530
  "<ul",
837
531
  " class=\"relationship-picker__selection\">",
@@ -916,19 +610,129 @@ function RelationshipPicker(props) {
916
610
  })));
917
611
  }
918
612
  //#endregion
919
- //#region src/components/content/FieldRenderer.tsx
920
- var _tmpl$$1 = ["<span", " class=\"field-renderer__required\">*</span>"];
613
+ //#region src/content/PluginFieldRenderer.jsx
614
+ var _tmpl$$1 = ["<div", " class=\"fb-plugin-field-renderer fb-plugin-field-renderer--loading\"><div class=\"fb-spinner\" aria-hidden=\"true\"></div><span>Carregando editor...</span></div>"];
921
615
  var _tmpl$2$1 = [
616
+ "<div",
617
+ " class=\"fb-renderer-error\"><i data-lucide=\"alert-circle\" aria-hidden=\"true\"></i><span>",
618
+ "</span></div>"
619
+ ];
620
+ var _tmpl$3$1 = [
621
+ "<div",
622
+ " class=\"fb-plugin-field-renderer fb-plugin-field-renderer--fallback\"><!--$-->",
623
+ "<!--/--><!--$-->",
624
+ "<!--/--></div>"
625
+ ];
626
+ var _tmpl$4$1 = [
627
+ "<div",
628
+ " class=\"fb-plugin-field-renderer\">",
629
+ "</div>"
630
+ ];
631
+ var _tmpl$5$1 = [
632
+ "<textarea",
633
+ " class=\"input fb-plugin-fallback-textarea\"",
634
+ "",
635
+ " spellcheck=\"false\"></textarea>"
636
+ ];
637
+ var _tmpl$6$1 = [
638
+ "<input",
639
+ " type=\"number\" class=\"input\"",
640
+ "",
641
+ ">"
642
+ ];
643
+ var _tmpl$7$1 = [
644
+ "<input",
645
+ " type=\"text\" class=\"input\"",
646
+ "",
647
+ ">"
648
+ ];
649
+ function PluginFieldRenderer(props) {
650
+ const [Component, setComponent] = createSignal(null);
651
+ const [error, setError] = createSignal(null);
652
+ const [loading, setLoading] = createSignal(true);
653
+ const [triedRenderer, setTriedRenderer] = createSignal(false);
654
+ onMount(async () => {
655
+ const pathsToTry = [props.adminRendererPath, props.adminComponentPath].filter(Boolean);
656
+ for (const path of pathsToTry) try {
657
+ const module = await import(path);
658
+ const Comp = module.default || module.PluginFieldRenderer || module.PluginFieldConfig || module[Object.keys(module)[0]];
659
+ if (Comp) {
660
+ setComponent(Comp);
661
+ setLoading(false);
662
+ return;
663
+ }
664
+ } catch (e) {
665
+ console.debug(`[PluginFieldRenderer] Failed to load ${path}:`, e);
666
+ }
667
+ if (props.adminRendererPath && !triedRenderer()) setTriedRenderer(true);
668
+ setError("Componente de renderização não encontrado");
669
+ setLoading(false);
670
+ });
671
+ const handleValueChange = (newValue) => {
672
+ props.onChange(newValue);
673
+ };
674
+ if (loading) return ssr(_tmpl$$1, ssrHydrationKey());
675
+ if (error || !Component) return ssr(_tmpl$3$1, ssrHydrationKey(), escape(createComponent(Show, {
676
+ get when() {
677
+ return error();
678
+ },
679
+ get children() {
680
+ return ssr(_tmpl$2$1, ssrHydrationKey(), escape(error()));
681
+ }
682
+ })), escape(createComponent(FallbackRenderer, {
683
+ get field() {
684
+ return props.field;
685
+ },
686
+ get value() {
687
+ return props.value;
688
+ },
689
+ onChange: handleValueChange,
690
+ get disabled() {
691
+ return props.disabled;
692
+ },
693
+ get t() {
694
+ return props.t;
695
+ }
696
+ })));
697
+ return ssr(_tmpl$4$1, ssrHydrationKey(), escape(createComponent(Component, {
698
+ get field() {
699
+ return props.field;
700
+ },
701
+ get value() {
702
+ return props.value;
703
+ },
704
+ onChange: handleValueChange,
705
+ get disabled() {
706
+ return props.disabled;
707
+ },
708
+ get t() {
709
+ return props.t;
710
+ }
711
+ })));
712
+ }
713
+ function FallbackRenderer(props) {
714
+ const { field, value, onChange, disabled, t } = props;
715
+ const inputType = field.config?.inputType || "textarea";
716
+ const placeholder = field.config?.placeholder || "";
717
+ const rows = field.config?.rows || 4;
718
+ if (inputType === "textarea" || inputType === "code" || inputType === "markdown") return ssr(_tmpl$5$1, ssrHydrationKey(), ssrAttribute("value", escape(value, true), false) + ssrAttribute("placeholder", escape(placeholder, true), false) + ssrAttribute("rows", escape(rows, true), false), ssrAttribute("disabled", disabled, true));
719
+ if (inputType === "number") return ssr(_tmpl$6$1, ssrHydrationKey(), ssrAttribute("value", escape(value, true), false) + ssrAttribute("placeholder", escape(placeholder, true), false), ssrAttribute("disabled", disabled, true));
720
+ return ssr(_tmpl$7$1, ssrHydrationKey(), ssrAttribute("value", escape(value, true), false) + ssrAttribute("placeholder", escape(placeholder, true), false), ssrAttribute("disabled", disabled, true));
721
+ }
722
+ //#endregion
723
+ //#region src/components/content/FieldRenderer.jsx
724
+ var _tmpl$ = ["<span", " class=\"field-renderer__required\">*</span>"];
725
+ var _tmpl$2 = [
922
726
  "<p",
923
727
  " class=\"field-renderer__instructions\">",
924
728
  "</p>"
925
729
  ];
926
- var _tmpl$3$1 = [
730
+ var _tmpl$3 = [
927
731
  "<p",
928
732
  " class=\"field-renderer__error\" role=\"alert\">",
929
733
  "</p>"
930
734
  ];
931
- var _tmpl$4$1 = [
735
+ var _tmpl$4 = [
932
736
  "<div",
933
737
  " class=\"field-renderer\"",
934
738
  "><label class=\"field-renderer__label\"><!--$-->",
@@ -938,25 +742,25 @@ var _tmpl$4$1 = [
938
742
  "<!--/--><!--$-->",
939
743
  "<!--/--></div>"
940
744
  ];
941
- var _tmpl$5$1 = [
745
+ var _tmpl$5 = [
942
746
  "<input",
943
747
  " type=\"text\" class=\"input\"",
944
748
  ">"
945
749
  ];
946
- var _tmpl$6$1 = [
750
+ var _tmpl$6 = [
947
751
  "<textarea",
948
752
  " class=\"input\"",
949
753
  "></textarea>"
950
754
  ];
951
- var _tmpl$7$1 = ["<textarea", " class=\"input wysiwyg\" rows=\"8\"></textarea>"];
952
- var _tmpl$8$1 = [
755
+ var _tmpl$7 = ["<textarea", " class=\"input wysiwyg\" rows=\"8\"></textarea>"];
756
+ var _tmpl$8 = [
953
757
  "<input",
954
758
  " type=\"number\" class=\"input\"",
955
759
  ">"
956
760
  ];
957
- var _tmpl$9$1 = ["<input", " type=\"email\" class=\"input\">"];
958
- var _tmpl$0$1 = ["<input", " type=\"url\" class=\"input\" placeholder=\"https://\">"];
959
- var _tmpl$1$1 = ["<input", " type=\"password\" class=\"input\">"];
761
+ var _tmpl$9 = ["<input", " type=\"email\" class=\"input\">"];
762
+ var _tmpl$0 = ["<input", " type=\"url\" class=\"input\" placeholder=\"https://\">"];
763
+ var _tmpl$1 = ["<input", " type=\"password\" class=\"input\">"];
960
764
  var _tmpl$10 = [
961
765
  "<input",
962
766
  " type=\"checkbox\"",
@@ -1107,19 +911,19 @@ function FieldRenderer(props) {
1107
911
  return memo(() => !!visible())() && !LAYOUT_ONLY.has(props.field.type);
1108
912
  },
1109
913
  get children() {
1110
- return ssr(_tmpl$4$1, ssrHydrationKey(), ssrAttribute("data-field-type", escape(props.field.type, true), false), escape(props.field.label), escape(createComponent(Show, {
914
+ return ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("data-field-type", escape(props.field.type, true), false), escape(props.field.label), escape(createComponent(Show, {
1111
915
  get when() {
1112
916
  return props.field.required;
1113
917
  },
1114
918
  get children() {
1115
- return ssr(_tmpl$$1, ssrHydrationKey());
919
+ return ssr(_tmpl$, ssrHydrationKey());
1116
920
  }
1117
921
  })), escape(createComponent(Show, {
1118
922
  get when() {
1119
923
  return props.field.instructions;
1120
924
  },
1121
925
  get children() {
1122
- return ssr(_tmpl$2$1, ssrHydrationKey(), escape(props.field.instructions));
926
+ return ssr(_tmpl$2, ssrHydrationKey(), escape(props.field.instructions));
1123
927
  }
1124
928
  })), escape(createComponent(FieldControl, {
1125
929
  get field() {
@@ -1137,7 +941,7 @@ function FieldRenderer(props) {
1137
941
  return validationError();
1138
942
  },
1139
943
  get children() {
1140
- return ssr(_tmpl$3$1, ssrHydrationKey(), escape(validationError()));
944
+ return ssr(_tmpl$3, ssrHydrationKey(), escape(validationError()));
1141
945
  }
1142
946
  })));
1143
947
  }
@@ -1146,15 +950,15 @@ function FieldRenderer(props) {
1146
950
  function FieldControl(props) {
1147
951
  const config = () => props.field.config ?? {};
1148
952
  switch (props.field.type) {
1149
- case "text": return ssr(_tmpl$5$1, ssrHydrationKey(), ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("placeholder", escape(config()["placeholder"], true), false) + ssrAttribute("maxlength", escape(config()["maxLength"] ?? config()["characterLimit"], true), false));
1150
- case "textarea": return ssr(_tmpl$6$1, ssrHydrationKey(), ssrAttribute("rows", escape(config()["rows"] ?? 4, true), false) + ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("placeholder", escape(config()["placeholder"], true), false) + ssrAttribute("maxlength", escape(config()["maxLength"] ?? config()["characterLimit"], true), false));
1151
- case "wysiwyg": return ssr(_tmpl$7$1, ssrHydrationKey());
953
+ case "text": return ssr(_tmpl$5, ssrHydrationKey(), ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("placeholder", escape(config()["placeholder"], true), false) + ssrAttribute("maxlength", escape(config()["maxLength"] ?? config()["characterLimit"], true), false));
954
+ case "textarea": return ssr(_tmpl$6, ssrHydrationKey(), ssrAttribute("rows", escape(config()["rows"] ?? 4, true), false) + ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("placeholder", escape(config()["placeholder"], true), false) + ssrAttribute("maxlength", escape(config()["maxLength"] ?? config()["characterLimit"], true), false));
955
+ case "wysiwyg": return ssr(_tmpl$7, ssrHydrationKey());
1152
956
  case "number":
1153
- case "range": return ssr(_tmpl$8$1, ssrHydrationKey(), ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("min", escape(config()["min"] ?? config()["minValue"], true), false) + ssrAttribute("max", escape(config()["max"] ?? config()["maxValue"], true), false) + ssrAttribute("step", escape(config()["step"], true), false));
1154
- case "email": return ssr(_tmpl$9$1, ssrHydrationKey());
1155
- case "url": return ssr(_tmpl$0$1, ssrHydrationKey());
1156
- case "password": return ssr(_tmpl$1$1, ssrHydrationKey());
1157
- case "slug": return ssr(_tmpl$5$1, ssrHydrationKey(), ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("placeholder", escape(config()["placeholder"], true), false));
957
+ case "range": return ssr(_tmpl$8, ssrHydrationKey(), ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("min", escape(config()["min"] ?? config()["minValue"], true), false) + ssrAttribute("max", escape(config()["max"] ?? config()["maxValue"], true), false) + ssrAttribute("step", escape(config()["step"], true), false));
958
+ case "email": return ssr(_tmpl$9, ssrHydrationKey());
959
+ case "url": return ssr(_tmpl$0, ssrHydrationKey());
960
+ case "password": return ssr(_tmpl$1, ssrHydrationKey());
961
+ case "slug": return ssr(_tmpl$5, ssrHydrationKey(), ssrAttribute("value", escape(props.value ?? config()["defaultValue"] ?? "", true), false) + ssrAttribute("placeholder", escape(config()["placeholder"], true), false));
1158
962
  case "true_false": return ssr(_tmpl$10, ssrHydrationKey(), ssrAttribute("checked", Boolean(props.value), true));
1159
963
  case "select": return ssr(_tmpl$11, ssrHydrationKey(), ssrAttribute("multiple", config()["multiple"] === true, true), escape(createComponent(For, {
1160
964
  get each() {
@@ -1328,7 +1132,28 @@ function FieldControl(props) {
1328
1132
  })
1329
1133
  })
1330
1134
  })));
1331
- default: return ssr(_tmpl$27, ssrHydrationKey());
1135
+ default:
1136
+ if (props.field.isPluginType && (props.field.adminRendererPath || props.field.adminComponentPath)) return createComponent(PluginFieldRenderer, {
1137
+ get field() {
1138
+ return props.field;
1139
+ },
1140
+ get value() {
1141
+ return props.value;
1142
+ },
1143
+ get onChange() {
1144
+ return props.onChange;
1145
+ },
1146
+ get adminRendererPath() {
1147
+ return props.field.adminRendererPath;
1148
+ },
1149
+ get adminComponentPath() {
1150
+ return props.field.adminComponentPath;
1151
+ },
1152
+ get t() {
1153
+ return props.t;
1154
+ }
1155
+ });
1156
+ return ssr(_tmpl$27, ssrHydrationKey());
1332
1157
  }
1333
1158
  }
1334
1159
  function RepeaterRow(props) {
@@ -1361,258 +1186,4 @@ function RelationshipSelector(props) {
1361
1186
  })));
1362
1187
  }
1363
1188
  //#endregion
1364
- //#region src/components/content/ContentEditor.tsx
1365
- var _tmpl$ = [
1366
- "<div",
1367
- " class=\"notice notice--success\">",
1368
- "</div>"
1369
- ];
1370
- var _tmpl$2 = [
1371
- "<input",
1372
- " class=\"classic-editor__title\" required",
1373
- ">"
1374
- ];
1375
- var _tmpl$3 = [
1376
- "<div",
1377
- " class=\"classic-editor__toolbar\" role=\"toolbar\"",
1378
- "><button type=\"button\"><strong>B</strong></button><button type=\"button\"><em>I</em></button><button type=\"button\"><u>U</u></button><span class=\"classic-editor__toolbar-divider\"></span><button type=\"button\">❝</button><button type=\"button\">• List</button><button type=\"button\">1. List</button><button type=\"button\">Link</button></div>"
1379
- ];
1380
- var _tmpl$4 = [
1381
- "<div",
1382
- " class=\"classic-editor__body\" contenteditable=\"true\" data-classic-editor role=\"textbox\" aria-multiline=\"true\"",
1383
- ">",
1384
- "</div>"
1385
- ];
1386
- var _tmpl$5 = [
1387
- "<label",
1388
- " class=\"classic-editor__excerpt\"><span>",
1389
- "</span><textarea class=\"input\" rows=\"4\"",
1390
- "></textarea></label>"
1391
- ];
1392
- var _tmpl$6 = [
1393
- "<section",
1394
- " class=\"card custom-fields\"><h3>",
1395
- "</h3><!--$-->",
1396
- "<!--/--></section>"
1397
- ];
1398
- var _tmpl$7 = [
1399
- "<section",
1400
- " class=\"card classic-editor__panel\"><h3>",
1401
- "</h3><input class=\"input\"",
1402
- "><p class=\"muted\">",
1403
- "</p></section>"
1404
- ];
1405
- var _tmpl$8 = [
1406
- "<section",
1407
- " class=\"card classic-editor__panel\"><h3>",
1408
- "</h3><label><!--$-->",
1409
- "<!--/--><select class=\"input\"",
1410
- "><option value>",
1411
- "</option><!--$-->",
1412
- "<!--/--></select></label></section>"
1413
- ];
1414
- var _tmpl$9 = [
1415
- "<form",
1416
- " class=\"content-editor classic-editor\"><!--$-->",
1417
- "<!--/--><!--$-->",
1418
- "<!--/--><div class=\"classic-editor__topbar\"><div><span class=\"classic-editor__eyebrow\">",
1419
- "</span><h2>",
1420
- "</h2></div><div class=\"classic-editor__actions\"><a class=\"btn btn-secondary\" href=\"",
1421
- "\">",
1422
- "</a><button type=\"submit\" class=\"btn btn-primary\"",
1423
- ">",
1424
- "</button></div></div><div class=\"classic-editor__columns\"><main class=\"classic-editor__main\"><section class=\"card classic-editor__canvas-card\"><!--$-->",
1425
- "<!--/--><div class=\"classic-editor__permalink\"><span><!--$-->",
1426
- "<!--/-->:</span><input class=\"input\"",
1427
- "></div><!--$-->",
1428
- "<!--/--><!--$-->",
1429
- "<!--/--></section><!--$-->",
1430
- "<!--/--></main><aside class=\"classic-editor__sidebar\"><section class=\"card classic-editor__panel\"><h3>",
1431
- "</h3><label><!--$-->",
1432
- "<!--/--><select class=\"input\"",
1433
- "><option value=\"DRAFT\">",
1434
- "</option><option value=\"PUBLISHED\">",
1435
- "</option><option value=\"ARCHIVED\">",
1436
- "</option></select></label><button type=\"submit\" class=\"btn btn-primary classic-editor__full-button\"",
1437
- ">",
1438
- "</button></section><!--$-->",
1439
- "<!--/--><!--$-->",
1440
- "<!--/--></aside></div></form>"
1441
- ];
1442
- var _tmpl$0 = [
1443
- "<div",
1444
- " class=\"notice notice--error\">",
1445
- "</div>"
1446
- ];
1447
- var _tmpl$1 = [
1448
- "<option",
1449
- ">",
1450
- "</option>"
1451
- ];
1452
- function ContentEditor(props) {
1453
- const { t } = useTranslation();
1454
- const [types, setTypes] = createSignal([]);
1455
- const [groups, setGroups] = createSignal([]);
1456
- const [themes, setThemes] = createSignal([]);
1457
- const [data, setData] = createSignal({});
1458
- const [errors, setErrors] = createSignal([]);
1459
- const [saving, setSaving] = createSignal(false);
1460
- const [message, setMessage] = createSignal("");
1461
- const [draft, setDraft] = createSignal({
1462
- type: props.initialType || "post",
1463
- title: "",
1464
- status: "DRAFT"
1465
- });
1466
- const supports = () => new Set(types().find((type) => type.slug === draft().type)?.supports ?? ["title", "editor"]);
1467
- const hasSupport = (support) => supports().has(support);
1468
- const typeListFallback = (available, requested) => requested || available[0]?.slug || "post";
1469
- const availableLayouts = () => {
1470
- const layouts = /* @__PURE__ */ new Set();
1471
- for (const theme of themes()) for (const layout of theme.manifest?.provides?.layouts ?? []) layouts.add(layout);
1472
- return [...layouts].sort();
1473
- };
1474
- const loadGroups = async (context) => {
1475
- try {
1476
- const query = typeof context === "string" ? { type: context } : context;
1477
- const all = await apiClient.getFieldGroups(query.type ? query : void 0);
1478
- const resolved = await Promise.all(all.filter((group) => group.active).map(async (group) => {
1479
- return (await apiClient.getFieldGroup(group.id)).fields ?? [];
1480
- }));
1481
- setGroups(expandCloneFields(resolved.flat()));
1482
- } catch (err) {
1483
- setErrors([err instanceof Error ? err.message : String(err)]);
1484
- }
1485
- };
1486
- onMount(async () => {
1487
- let typeList = [];
1488
- try {
1489
- const [typeCatalog, themeList] = await Promise.all([apiClient.getContentTypes(), apiClient.getThemes().catch(() => [])]);
1490
- typeList = typeCatalog;
1491
- setTypes(typeCatalog);
1492
- setThemes(themeList);
1493
- } catch (err) {
1494
- setErrors([err instanceof Error ? err.message : String(err)]);
1495
- }
1496
- const editId = new URLSearchParams(window.location.search).get("id");
1497
- if (editId || props.singleton) try {
1498
- const existing = editId ? await apiClient.getContentById(editId) : await apiClient.getSingletonContent(draft().type);
1499
- if (!existing) {
1500
- await loadGroups({
1501
- type: draft().type,
1502
- status: draft().status
1503
- });
1504
- return;
1505
- }
1506
- const rawRow = existing;
1507
- setDraft({
1508
- id: existing.id,
1509
- type: existing.type,
1510
- title: existing.title,
1511
- slug: existing.slug,
1512
- excerpt: existing.excerpt,
1513
- featuredImageId: rawRow["featuredImageId"] ?? rawRow["featured_image_id"],
1514
- status: existing.status,
1515
- layout: existing.layout
1516
- });
1517
- setData(existing.body ?? {});
1518
- } catch (err) {
1519
- setErrors([err instanceof Error ? err.message : String(err)]);
1520
- }
1521
- else if (!typeList.some((type) => type.slug === draft().type)) setDraft({
1522
- ...draft(),
1523
- type: typeListFallback(typeList, props.initialType)
1524
- });
1525
- await loadGroups({
1526
- type: draft().type,
1527
- slug: draft().slug,
1528
- status: draft().status
1529
- });
1530
- });
1531
- const editorContent = () => {
1532
- const value = data()["content"];
1533
- return typeof value === "string" ? value : "";
1534
- };
1535
- return ssr(_tmpl$9, ssrHydrationKey(), escape(createComponent(Show, {
1536
- get when() {
1537
- return errors().length > 0;
1538
- },
1539
- get children() {
1540
- return createComponent(For, {
1541
- get each() {
1542
- return errors();
1543
- },
1544
- children: (err) => ssr(_tmpl$0, ssrHydrationKey(), escape(err))
1545
- });
1546
- }
1547
- })), escape(createComponent(Show, {
1548
- get when() {
1549
- return message();
1550
- },
1551
- get children() {
1552
- return ssr(_tmpl$, ssrHydrationKey(), escape(message()));
1553
- }
1554
- })), escape(types().find((type) => type.slug === draft().type)?.singularLabel || draft().type), draft().id ? escape(t("content.editor.editing")) : escape(t("content.editor.adding")), `/content/${escape(encodeURIComponent(draft().type), true)}`, escape(t("content.editor.backToList")), ssrAttribute("disabled", saving(), true), saving() ? escape(t("content.editor.saving")) : escape(t("content.editor.save")), escape(createComponent(Show, {
1555
- get when() {
1556
- return hasSupport("title");
1557
- },
1558
- get children() {
1559
- return ssr(_tmpl$2, ssrHydrationKey(), ssrAttribute("aria-label", escape(t("content.editor.title"), true), false) + ssrAttribute("placeholder", escape(t("content.editor.titlePlaceholder"), true), false) + ssrAttribute("value", escape(draft().title, true), false));
1560
- }
1561
- })), escape(t("content.editor.slug")), ssrAttribute("value", escape(draft().slug ?? "", true), false) + ssrAttribute("placeholder", escape(t("content.editor.slugPlaceholder"), true), false), escape(createComponent(Show, {
1562
- get when() {
1563
- return hasSupport("editor");
1564
- },
1565
- get children() {
1566
- return [ssr(_tmpl$3, ssrHydrationKey(), ssrAttribute("aria-label", escape(t("content.editor.toolbar"), true), false)), ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("data-placeholder", escape(t("content.editor.bodyPlaceholder"), true), false), sanitizeHtml(editorContent()))];
1567
- }
1568
- })), escape(createComponent(Show, {
1569
- get when() {
1570
- return hasSupport("excerpt");
1571
- },
1572
- get children() {
1573
- return ssr(_tmpl$5, ssrHydrationKey(), escape(t("content.editor.excerpt")), ssrAttribute("value", escape(draft().excerpt ?? "", true), false));
1574
- }
1575
- })), escape(createComponent(Show, {
1576
- get when() {
1577
- return groups().length > 0;
1578
- },
1579
- get children() {
1580
- return ssr(_tmpl$6, ssrHydrationKey(), escape(t("content.editor.customFields")), escape(createComponent(For, {
1581
- get each() {
1582
- return groups();
1583
- },
1584
- children: (field) => createComponent(FieldRenderer, {
1585
- field,
1586
- get values() {
1587
- return data();
1588
- },
1589
- onChange: (name, value) => setData({
1590
- ...data(),
1591
- [name]: value
1592
- })
1593
- })
1594
- })));
1595
- }
1596
- })), escape(t("content.editor.publishPanel")), escape(t("content.editor.status")), ssrAttribute("value", escape(draft().status, true), false), escape(t("content.editor.statusOptions.draft")), escape(t("content.editor.statusOptions.published")), escape(t("content.editor.statusOptions.archived")), ssrAttribute("disabled", saving(), true), saving() ? escape(t("content.editor.saving")) : escape(t("content.editor.save")), escape(createComponent(Show, {
1597
- get when() {
1598
- return hasSupport("thumbnail");
1599
- },
1600
- get children() {
1601
- return ssr(_tmpl$7, ssrHydrationKey(), escape(t("content.editor.featuredImage")), ssrAttribute("value", escape(draft().featuredImageId ?? "", true), false) + ssrAttribute("placeholder", escape(t("content.editor.mediaIdPlaceholder"), true), false), escape(t("content.editor.featuredImageHint")));
1602
- }
1603
- })), escape(createComponent(Show, {
1604
- get when() {
1605
- return availableLayouts().length > 0;
1606
- },
1607
- get children() {
1608
- return ssr(_tmpl$8, ssrHydrationKey(), escape(t("content.editor.pageAttributes")), escape(t("content.editor.layout")), ssrAttribute("value", escape(draft().layout ?? "", true), false), escape(t("content.editor.layoutAuto")), escape(createComponent(For, {
1609
- get each() {
1610
- return availableLayouts();
1611
- },
1612
- children: (layout) => ssr(_tmpl$1, ssrHydrationKey() + ssrAttribute("value", escape(layout, true), false), escape(layout))
1613
- })));
1614
- }
1615
- })));
1616
- }
1617
- //#endregion
1618
- export { ContentEditor as t };
1189
+ export { expandCloneFields as n, FieldRenderer as t };