@vigilkids/section-renderer-vue 0.0.1

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 (140) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -0
  3. package/dist/assets/images/article/arrow.svg +3 -0
  4. package/dist/assets/images/article/hot.svg +3 -0
  5. package/dist/assets/images/article/notice-info-icon.svg +5 -0
  6. package/dist/assets/images/article/notice-info.svg +3 -0
  7. package/dist/assets/images/article/notice-warning-icon.svg +5 -0
  8. package/dist/assets/images/article/notice-warning.svg +10 -0
  9. package/dist/assets/images/article/question.svg +10 -0
  10. package/dist/composables/useInlineEdit.d.ts +30 -0
  11. package/dist/composables/useInlineEdit.mjs +94 -0
  12. package/dist/composables/useLazyRender.d.ts +18 -0
  13. package/dist/composables/useLazyRender.mjs +33 -0
  14. package/dist/composables/useRegistry.d.ts +38 -0
  15. package/dist/composables/useRegistry.mjs +60 -0
  16. package/dist/composables/useSectionSEO.d.ts +26 -0
  17. package/dist/composables/useSectionSEO.mjs +122 -0
  18. package/dist/composables/useSectionStyle.d.ts +23 -0
  19. package/dist/composables/useSectionStyle.mjs +111 -0
  20. package/dist/editor.d.ts +4 -0
  21. package/dist/editor.mjs +9 -0
  22. package/dist/index.d.ts +18 -0
  23. package/dist/index.mjs +14 -0
  24. package/dist/plugin.d.ts +6 -0
  25. package/dist/plugin.mjs +14 -0
  26. package/dist/preview/createPreviewApp.d.ts +20 -0
  27. package/dist/preview/createPreviewApp.mjs +161 -0
  28. package/dist/renderer/FallbackSection.d.vue.ts +8 -0
  29. package/dist/renderer/FallbackSection.vue +17 -0
  30. package/dist/renderer/FallbackSection.vue.d.ts +8 -0
  31. package/dist/renderer/LazySection.d.vue.ts +60 -0
  32. package/dist/renderer/LazySection.vue +115 -0
  33. package/dist/renderer/LazySection.vue.d.ts +60 -0
  34. package/dist/renderer/SectionErrorBoundary.d.vue.ts +16 -0
  35. package/dist/renderer/SectionErrorBoundary.vue +38 -0
  36. package/dist/renderer/SectionErrorBoundary.vue.d.ts +16 -0
  37. package/dist/renderer/SectionRenderer.d.vue.ts +29 -0
  38. package/dist/renderer/SectionRenderer.vue +99 -0
  39. package/dist/renderer/SectionRenderer.vue.d.ts +29 -0
  40. package/dist/renderer/SectionWrapper.d.vue.ts +24 -0
  41. package/dist/renderer/SectionWrapper.vue +52 -0
  42. package/dist/renderer/SectionWrapper.vue.d.ts +24 -0
  43. package/dist/sections/RichTextSection.d.vue.ts +9 -0
  44. package/dist/sections/RichTextSection.vue +135 -0
  45. package/dist/sections/RichTextSection.vue.d.ts +9 -0
  46. package/dist/sections/article/index.d.ts +2 -0
  47. package/dist/sections/article/index.mjs +174 -0
  48. package/dist/sections/article/prosemirror.d.ts +2 -0
  49. package/dist/sections/article/prosemirror.mjs +65 -0
  50. package/dist/sections/article/shared/ArticleCustomHtml.d.vue.ts +9 -0
  51. package/dist/sections/article/shared/ArticleCustomHtml.vue +32 -0
  52. package/dist/sections/article/shared/ArticleCustomHtml.vue.d.ts +9 -0
  53. package/dist/sections/article/shared/ArticleImage.d.vue.ts +21 -0
  54. package/dist/sections/article/shared/ArticleImage.vue +53 -0
  55. package/dist/sections/article/shared/ArticleImage.vue.d.ts +21 -0
  56. package/dist/sections/article/vigilkids/ArticleBulletList.d.vue.ts +21 -0
  57. package/dist/sections/article/vigilkids/ArticleBulletList.vue +48 -0
  58. package/dist/sections/article/vigilkids/ArticleBulletList.vue.d.ts +21 -0
  59. package/dist/sections/article/vigilkids/ArticleCta.d.vue.ts +21 -0
  60. package/dist/sections/article/vigilkids/ArticleCta.vue +126 -0
  61. package/dist/sections/article/vigilkids/ArticleCta.vue.d.ts +21 -0
  62. package/dist/sections/article/vigilkids/ArticleFaq.d.vue.ts +21 -0
  63. package/dist/sections/article/vigilkids/ArticleFaq.vue +62 -0
  64. package/dist/sections/article/vigilkids/ArticleFaq.vue.d.ts +21 -0
  65. package/dist/sections/article/vigilkids/ArticleFaqItem.d.vue.ts +5 -0
  66. package/dist/sections/article/vigilkids/ArticleFaqItem.vue +24 -0
  67. package/dist/sections/article/vigilkids/ArticleFaqItem.vue.d.ts +5 -0
  68. package/dist/sections/article/vigilkids/ArticleFeature.d.vue.ts +21 -0
  69. package/dist/sections/article/vigilkids/ArticleFeature.vue +77 -0
  70. package/dist/sections/article/vigilkids/ArticleFeature.vue.d.ts +21 -0
  71. package/dist/sections/article/vigilkids/ArticleHeading.d.vue.ts +21 -0
  72. package/dist/sections/article/vigilkids/ArticleHeading.vue +53 -0
  73. package/dist/sections/article/vigilkids/ArticleHeading.vue.d.ts +21 -0
  74. package/dist/sections/article/vigilkids/ArticleNotice.d.vue.ts +21 -0
  75. package/dist/sections/article/vigilkids/ArticleNotice.vue +81 -0
  76. package/dist/sections/article/vigilkids/ArticleNotice.vue.d.ts +21 -0
  77. package/dist/sections/article/vigilkids/ArticleProsCons.d.vue.ts +21 -0
  78. package/dist/sections/article/vigilkids/ArticleProsCons.vue +74 -0
  79. package/dist/sections/article/vigilkids/ArticleProsCons.vue.d.ts +21 -0
  80. package/dist/sections/article/vigilkids/ArticleQuestion.d.vue.ts +21 -0
  81. package/dist/sections/article/vigilkids/ArticleQuestion.vue +58 -0
  82. package/dist/sections/article/vigilkids/ArticleQuestion.vue.d.ts +21 -0
  83. package/dist/sections/article/vigilkids/ArticleQuote.d.vue.ts +21 -0
  84. package/dist/sections/article/vigilkids/ArticleQuote.vue +50 -0
  85. package/dist/sections/article/vigilkids/ArticleQuote.vue.d.ts +21 -0
  86. package/dist/sections/article/vigilkids/ArticleStepList.d.vue.ts +21 -0
  87. package/dist/sections/article/vigilkids/ArticleStepList.vue +49 -0
  88. package/dist/sections/article/vigilkids/ArticleStepList.vue.d.ts +21 -0
  89. package/dist/sections/article/vigilkids/ArticleSubheading.d.vue.ts +21 -0
  90. package/dist/sections/article/vigilkids/ArticleSubheading.vue +56 -0
  91. package/dist/sections/article/vigilkids/ArticleSubheading.vue.d.ts +21 -0
  92. package/dist/sections/article/vigilkids/ArticleTable.d.vue.ts +9 -0
  93. package/dist/sections/article/vigilkids/ArticleTable.vue +75 -0
  94. package/dist/sections/article/vigilkids/ArticleTable.vue.d.ts +9 -0
  95. package/dist/sections/article/vigilkids/ArticleToc.d.vue.ts +21 -0
  96. package/dist/sections/article/vigilkids/ArticleToc.vue +102 -0
  97. package/dist/sections/article/vigilkids/ArticleToc.vue.d.ts +21 -0
  98. package/dist/sections/article/visiva/ArticleBulletList.d.vue.ts +21 -0
  99. package/dist/sections/article/visiva/ArticleBulletList.vue +48 -0
  100. package/dist/sections/article/visiva/ArticleBulletList.vue.d.ts +21 -0
  101. package/dist/sections/article/visiva/ArticleCta.d.vue.ts +21 -0
  102. package/dist/sections/article/visiva/ArticleCta.vue +148 -0
  103. package/dist/sections/article/visiva/ArticleCta.vue.d.ts +21 -0
  104. package/dist/sections/article/visiva/ArticleFaq.d.vue.ts +21 -0
  105. package/dist/sections/article/visiva/ArticleFaq.vue +76 -0
  106. package/dist/sections/article/visiva/ArticleFaq.vue.d.ts +21 -0
  107. package/dist/sections/article/visiva/ArticleFeature.d.vue.ts +21 -0
  108. package/dist/sections/article/visiva/ArticleFeature.vue +79 -0
  109. package/dist/sections/article/visiva/ArticleFeature.vue.d.ts +21 -0
  110. package/dist/sections/article/visiva/ArticleHeading.d.vue.ts +21 -0
  111. package/dist/sections/article/visiva/ArticleHeading.vue +61 -0
  112. package/dist/sections/article/visiva/ArticleHeading.vue.d.ts +21 -0
  113. package/dist/sections/article/visiva/ArticleNotice.d.vue.ts +21 -0
  114. package/dist/sections/article/visiva/ArticleNotice.vue +102 -0
  115. package/dist/sections/article/visiva/ArticleNotice.vue.d.ts +21 -0
  116. package/dist/sections/article/visiva/ArticleProsCons.d.vue.ts +21 -0
  117. package/dist/sections/article/visiva/ArticleProsCons.vue +98 -0
  118. package/dist/sections/article/visiva/ArticleProsCons.vue.d.ts +21 -0
  119. package/dist/sections/article/visiva/ArticleQuestion.d.vue.ts +21 -0
  120. package/dist/sections/article/visiva/ArticleQuestion.vue +80 -0
  121. package/dist/sections/article/visiva/ArticleQuestion.vue.d.ts +21 -0
  122. package/dist/sections/article/visiva/ArticleQuote.d.vue.ts +21 -0
  123. package/dist/sections/article/visiva/ArticleQuote.vue +50 -0
  124. package/dist/sections/article/visiva/ArticleQuote.vue.d.ts +21 -0
  125. package/dist/sections/article/visiva/ArticleStepList.d.vue.ts +21 -0
  126. package/dist/sections/article/visiva/ArticleStepList.vue +48 -0
  127. package/dist/sections/article/visiva/ArticleStepList.vue.d.ts +21 -0
  128. package/dist/sections/article/visiva/ArticleSubheading.d.vue.ts +21 -0
  129. package/dist/sections/article/visiva/ArticleSubheading.vue +91 -0
  130. package/dist/sections/article/visiva/ArticleSubheading.vue.d.ts +21 -0
  131. package/dist/sections/article/visiva/ArticleTable.d.vue.ts +9 -0
  132. package/dist/sections/article/visiva/ArticleTable.vue +140 -0
  133. package/dist/sections/article/visiva/ArticleTable.vue.d.ts +9 -0
  134. package/dist/sections/article/visiva/ArticleToc.d.vue.ts +21 -0
  135. package/dist/sections/article/visiva/ArticleToc.vue +116 -0
  136. package/dist/sections/article/visiva/ArticleToc.vue.d.ts +21 -0
  137. package/dist/shims-css.d.ts +4 -0
  138. package/dist/styles/products/vigilkids.css +1 -0
  139. package/dist/styles/products/visiva.css +1 -0
  140. package/package.json +43 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present VigilKids
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @vigilkids/section-renderer-vue
2
+
3
+ Vue 3 rendering engine for OneX Section system. Renders section-based content with product-aware component resolution, lazy loading, inline editing, and editor preview support.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @vigilkids/section-renderer-vue
9
+ ```
10
+
11
+ **Peer Dependencies:**
12
+ - `vue` ≥ 3.4
13
+ - `@vigilkids/section-core` (workspace)
14
+
15
+ ## Usage
16
+
17
+ ### Frontend (Nuxt/Vue app)
18
+
19
+ ```vue
20
+ <script setup>
21
+ import { SectionRenderer, registerArticleSections, SectionRendererPlugin } from '@vigilkids/section-renderer-vue'
22
+
23
+ // Register built-in article sections (call once at app startup)
24
+ registerArticleSections()
25
+ </script>
26
+
27
+ <template>
28
+ <SectionRenderer
29
+ :sections-data="article.content_json"
30
+ :product-code="'visiva'"
31
+ />
32
+ </template>
33
+ ```
34
+
35
+ ### Admin Preview (iframe)
36
+
37
+ ```typescript
38
+ import { createPreviewApp } from '@vigilkids/section-renderer-vue/editor'
39
+
40
+ createPreviewApp('#app', {
41
+ bridge: { send, on },
42
+ onSectionClick: (id) => { /* select section */ },
43
+ })
44
+ ```
45
+
46
+ ### Product Styles
47
+
48
+ ```typescript
49
+ // Import product-specific article CSS
50
+ import '@vigilkids/section-renderer-vue/styles/vigilkids'
51
+ import '@vigilkids/section-renderer-vue/styles/visiva'
52
+ ```
53
+
54
+ ## Components
55
+
56
+ | Component | Purpose |
57
+ |-----------|---------|
58
+ | `SectionRenderer` | Root renderer — iterates sections, resolves components |
59
+ | `SectionWrapper` | Per-section container with editor-mode highlights |
60
+ | `LazySection` | IntersectionObserver lazy loading with CLS prevention |
61
+ | `SectionErrorBoundary` | Graceful error fallback per section |
62
+ | `FallbackSection` | Placeholder for unregistered section types |
63
+
64
+ ## Composables
65
+
66
+ | Composable | Purpose |
67
+ |------------|---------|
68
+ | `useInlineEdit` | contentEditable inline text editing (double-click to edit) |
69
+ | `useRegistry` | Product-aware section component registration and resolution |
70
+ | `useSectionStyle` | Semantic tokens → Tailwind classes + inline styles |
71
+ | `useSectionSEO` | JSON-LD structured data generation |
72
+ | `useLazyRender` | IntersectionObserver visibility detection |
73
+
74
+ ## Section Components
75
+
76
+ 28 article sections across 2 products (VigilKids + Visiva) + 2 shared:
77
+
78
+ `article-heading`, `article-subheading`, `article-image`, `article-bullet-list`, `article-step-list`, `article-notice`, `article-quote`, `article-question`, `article-pros-cons`, `article-feature`, `article-cta`, `article-faq`, `article-table`, `article-toc`, `article-custom-html`
79
+
80
+ ## Compatibility
81
+
82
+ - Vue ≥ 3.4
83
+ - Node.js ≥ 18
84
+ - ESM only
85
+
86
+ ## License
87
+
88
+ [MIT](./LICENSE)
@@ -0,0 +1,3 @@
1
+ <svg width="21" height="12" viewBox="0 0 21 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M20.5303 6.53033C20.8232 6.23744 20.8232 5.76256 20.5303 5.46967L15.7574 0.696699C15.4645 0.403806 14.9896 0.403806 14.6967 0.696699C14.4038 0.989593 14.4038 1.46447 14.6967 1.75736L18.9393 6L14.6967 10.2426C14.4038 10.5355 14.4038 11.0104 14.6967 11.3033C14.9896 11.5962 15.4645 11.5962 15.7574 11.3033L20.5303 6.53033ZM0 6V6.75H20V6V5.25H0V6Z" fill="#24C790"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.5479 11.9702C10.0966 11.9702 9.71456 12.5389 9.71456 13.2188C9.71456 13.8948 10.0966 14.4668 10.5479 14.4668C10.9992 14.4668 11.3819 13.8968 11.3819 13.2175C11.3819 12.5389 10.9999 11.9689 10.5485 11.9689L10.5479 11.9702ZM15.3977 3.54841C15.3258 3.46817 15.2338 3.40848 15.1312 3.37545C15.0286 3.34242 14.919 3.33723 14.8138 3.36042C14.6018 3.41108 14.4271 3.57374 14.3471 3.79507C14.1688 4.31816 14.0036 4.84565 13.8518 5.37704C13.6385 4.93438 13.3985 4.50972 13.1318 4.10374C12.1478 2.60444 10.7985 1.3318 8.88657 0.0985037C8.7956 0.0391916 8.69032 0.00547728 8.58182 0.000902909C8.47331 -0.00367146 8.36558 0.021063 8.26993 0.0725076C8.17116 0.129583 8.08767 0.209723 8.02661 0.306079C7.96554 0.402435 7.92871 0.512143 7.91927 0.625828C7.65327 3.22973 7.16395 5.86901 5.492 7.72696L5.27001 7.25364C5.0747 6.84432 4.89202 6.45901 4.7747 6.12901C4.64802 5.76569 4.27671 5.5837 3.94538 5.72237C3.7931 5.78848 3.67093 5.90898 3.60272 6.06034L3.46806 6.347C2.64741 8.08696 1.52544 10.4736 1.3561 12.4915C1.00477 16.7687 4.55669 19.4567 8.25059 19.9033C9.06192 20.0013 9.87722 20.0233 10.6919 19.9733C13.5965 19.784 17.125 18.1554 18.3143 14.1468C19.0843 11.5449 18.7837 7.21032 15.3977 3.54708V3.54774V3.54841ZM7.82794 15.1521C7.82794 15.4901 7.57528 15.7655 7.26462 15.7655C6.95464 15.7668 6.70329 15.4921 6.70196 15.1521V13.7588L5.542 13.7788V15.1861C5.542 15.5234 5.28934 15.7994 4.97868 15.7994C4.66936 15.8008 4.41669 15.5261 4.41536 15.1861V11.4189C4.41536 11.0802 4.66735 10.8056 4.97868 10.8056C5.28934 10.8056 5.54134 11.0802 5.54134 11.4189V12.5515L6.70196 12.5322V11.3855C6.70196 11.0469 6.95395 10.7716 7.26462 10.7716C7.57528 10.7716 7.82727 11.0469 7.82727 11.3849V15.1515H7.82794V15.1521ZM10.5479 15.6908C9.4679 15.6908 8.59059 14.5801 8.59059 13.2155C8.59059 11.8509 9.4679 10.7402 10.5479 10.7402C11.6278 10.7402 12.5078 11.8509 12.5078 13.2155C12.5065 14.5801 11.6278 15.6908 10.5479 15.6908V15.6908ZM15.6504 12.1022H14.9351V15.1188C14.9351 15.4568 14.6838 15.7321 14.3731 15.7321C14.0631 15.7334 13.8111 15.4588 13.8091 15.1188V12.1022H13.0951C13.0202 12.1022 12.9461 12.0862 12.8778 12.0553C12.8095 12.0244 12.7486 11.9792 12.6991 11.9229C12.5931 11.8023 12.5339 11.6475 12.5325 11.4869C12.5325 11.1482 12.7845 10.8736 13.0951 10.8736H15.6484C15.9591 10.8736 16.2104 11.1482 16.2104 11.4869C16.2099 11.6477 16.1506 11.8028 16.0437 11.9229C15.9951 11.9796 15.9348 12.0251 15.8669 12.0562C15.799 12.0872 15.7251 12.1032 15.6504 12.1029V12.1022Z" fill="#F74343"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="142" height="40" viewBox="0 0 142 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 0H142L132.921 27.6208C130.493 35.0074 123.596 40 115.821 40H26.179C18.4036 40 11.5071 35.0074 9.07906 27.6208L0 0Z" fill="#24C790"/>
3
+ <path d="M51.1531 30.9568H51.1203C50.1031 30.9459 49.0832 30.9459 48.0633 30.9459H46.5074C45.4684 30.9459 44.4293 30.9459 43.3875 30.9322C42.8105 30.9158 42.2418 30.7955 41.7059 30.5768C40.7953 30.2213 40.2758 29.4283 40.2785 28.3975L40.2812 24.5311C40.2812 22.39 40.2813 20.2463 40.3004 18.1053C40.3031 17.5229 40.6777 16.976 40.9977 16.6889C42.2363 15.5568 43.5816 14.1459 44.1449 12.2428C44.3008 11.7123 44.3609 11.1271 44.4238 10.5092C44.5496 9.27871 45.348 8.47754 46.4145 8.47754C46.8328 8.47754 47.2512 8.60332 47.6613 8.84668C48.4844 9.3416 49.034 10.1182 49.3375 11.2256C49.8242 12.9838 49.5754 14.69 49.302 16.1529V16.1584C49.2391 16.5002 49.4961 16.8174 49.8461 16.8174H53.4008C54.0133 16.8174 54.891 16.8939 55.4324 17.5502C55.8262 18.0287 55.9383 18.674 55.7715 19.5271C55.2629 22.1494 54.6395 24.7936 54.0434 27.2572C53.8574 28.0256 53.5484 28.7365 53.2504 29.4256L53.1219 29.7209C52.7828 30.5193 52.0828 30.9568 51.1531 30.9568ZM35.909 30.6998H35.5836C34.4078 30.6998 33.4453 29.7373 33.4453 28.5615V19.0322C33.4453 17.8564 34.4078 16.8939 35.5836 16.8939H35.909C37.0848 16.8939 38.0473 17.8564 38.0473 19.0322V28.5588C38.05 29.7373 37.0875 30.6998 35.909 30.6998Z" fill="white"/>
4
+ <path d="M76.8066 21.9316H73.1836V19.6465H76.8066C77.3665 19.6465 77.8223 19.5553 78.1738 19.373C78.5254 19.1842 78.7826 18.9238 78.9453 18.5918C79.1081 18.2598 79.1895 17.8854 79.1895 17.4688C79.1895 17.0456 79.1081 16.6517 78.9453 16.2871C78.7826 15.9225 78.5254 15.6296 78.1738 15.4082C77.8223 15.1868 77.3665 15.0762 76.8066 15.0762H74.1992V27H71.2695V12.7812H76.8066C77.9199 12.7812 78.8737 12.9831 79.668 13.3867C80.4688 13.7839 81.0807 14.334 81.5039 15.0371C81.9271 15.7402 82.1387 16.5443 82.1387 17.4492C82.1387 18.3672 81.9271 19.1615 81.5039 19.832C81.0807 20.5026 80.4688 21.0202 79.668 21.3848C78.8737 21.7493 77.9199 21.9316 76.8066 21.9316ZM86.7969 18.7383V27H83.9844V16.4336H86.6309L86.7969 18.7383ZM89.9805 16.3652L89.9316 18.9727C89.7949 18.9531 89.6289 18.9368 89.4336 18.9238C89.2448 18.9043 89.0723 18.8945 88.916 18.8945C88.5189 18.8945 88.1738 18.9466 87.8809 19.0508C87.5944 19.1484 87.3535 19.2949 87.1582 19.4902C86.9694 19.6855 86.8262 19.9232 86.7285 20.2031C86.6374 20.4831 86.5853 20.8021 86.5723 21.1602L86.0059 20.9844C86.0059 20.3008 86.0742 19.6725 86.2109 19.0996C86.3477 18.5202 86.5462 18.0156 86.8066 17.5859C87.0736 17.1562 87.3991 16.8242 87.7832 16.5898C88.1673 16.3555 88.6068 16.2383 89.1016 16.2383C89.2578 16.2383 89.4173 16.2513 89.5801 16.2773C89.7428 16.2969 89.8763 16.3262 89.9805 16.3652ZM90.5664 21.8242V21.6191C90.5664 20.8444 90.6771 20.1315 90.8984 19.4805C91.1198 18.8229 91.4421 18.2533 91.8652 17.7715C92.2884 17.2897 92.8092 16.9154 93.4277 16.6484C94.0462 16.375 94.7559 16.2383 95.5566 16.2383C96.3574 16.2383 97.0703 16.375 97.6953 16.6484C98.3203 16.9154 98.8444 17.2897 99.2676 17.7715C99.6973 18.2533 100.023 18.8229 100.244 19.4805C100.465 20.1315 100.576 20.8444 100.576 21.6191V21.8242C100.576 22.5924 100.465 23.3053 100.244 23.9629C100.023 24.6139 99.6973 25.1836 99.2676 25.6719C98.8444 26.1536 98.3236 26.528 97.7051 26.7949C97.0866 27.0618 96.377 27.1953 95.5762 27.1953C94.7754 27.1953 94.0625 27.0618 93.4375 26.7949C92.819 26.528 92.2949 26.1536 91.8652 25.6719C91.4421 25.1836 91.1198 24.6139 90.8984 23.9629C90.6771 23.3053 90.5664 22.5924 90.5664 21.8242ZM93.3789 21.6191V21.8242C93.3789 22.2669 93.418 22.6803 93.4961 23.0645C93.5742 23.4486 93.6979 23.7871 93.8672 24.0801C94.043 24.3665 94.2708 24.5911 94.5508 24.7539C94.8307 24.9167 95.1725 24.998 95.5762 24.998C95.9668 24.998 96.3021 24.9167 96.582 24.7539C96.862 24.5911 97.0866 24.3665 97.2559 24.0801C97.4251 23.7871 97.5488 23.4486 97.627 23.0645C97.7116 22.6803 97.7539 22.2669 97.7539 21.8242V21.6191C97.7539 21.1895 97.7116 20.7858 97.627 20.4082C97.5488 20.0241 97.4219 19.6855 97.2461 19.3926C97.0768 19.0931 96.8522 18.8587 96.5723 18.6895C96.2923 18.5202 95.9538 18.4355 95.5566 18.4355C95.1595 18.4355 94.821 18.5202 94.541 18.6895C94.2676 18.8587 94.043 19.0931 93.8672 19.3926C93.6979 19.6855 93.5742 20.0241 93.4961 20.4082C93.418 20.7858 93.3789 21.1895 93.3789 21.6191ZM108.018 24.0801C108.018 23.8783 107.959 23.696 107.842 23.5332C107.725 23.3704 107.507 23.2207 107.188 23.084C106.875 22.9408 106.423 22.8105 105.83 22.6934C105.296 22.5762 104.798 22.4297 104.336 22.2539C103.88 22.0716 103.483 21.8535 103.145 21.5996C102.812 21.3457 102.552 21.0462 102.363 20.7012C102.174 20.3496 102.08 19.9492 102.08 19.5C102.08 19.0573 102.174 18.6406 102.363 18.25C102.559 17.8594 102.835 17.5143 103.193 17.2148C103.558 16.9089 104.001 16.6712 104.521 16.502C105.049 16.3262 105.641 16.2383 106.299 16.2383C107.217 16.2383 108.005 16.3848 108.662 16.6777C109.326 16.9707 109.834 17.3743 110.186 17.8887C110.544 18.3965 110.723 18.9759 110.723 19.627H107.91C107.91 19.3535 107.852 19.1094 107.734 18.8945C107.624 18.6732 107.448 18.5007 107.207 18.377C106.973 18.2467 106.667 18.1816 106.289 18.1816C105.977 18.1816 105.706 18.237 105.479 18.3477C105.251 18.4518 105.075 18.5951 104.951 18.7773C104.834 18.9531 104.775 19.1484 104.775 19.3633C104.775 19.526 104.808 19.6725 104.873 19.8027C104.945 19.9264 105.059 20.0404 105.215 20.1445C105.371 20.2487 105.573 20.3464 105.82 20.4375C106.074 20.5221 106.387 20.6003 106.758 20.6719C107.52 20.8281 108.2 21.0332 108.799 21.2871C109.398 21.5345 109.873 21.873 110.225 22.3027C110.576 22.7259 110.752 23.2826 110.752 23.9727C110.752 24.4414 110.648 24.8711 110.439 25.2617C110.231 25.6523 109.932 25.9941 109.541 26.2871C109.15 26.5736 108.682 26.7982 108.135 26.9609C107.594 27.1172 106.986 27.1953 106.309 27.1953C105.326 27.1953 104.492 27.0195 103.809 26.668C103.132 26.3164 102.617 25.8704 102.266 25.3301C101.921 24.7832 101.748 24.2233 101.748 23.6504H104.414C104.427 24.0345 104.525 24.3438 104.707 24.5781C104.896 24.8125 105.133 24.9818 105.42 25.0859C105.713 25.1901 106.029 25.2422 106.367 25.2422C106.732 25.2422 107.035 25.1934 107.275 25.0957C107.516 24.9915 107.699 24.8548 107.822 24.6855C107.952 24.5098 108.018 24.3079 108.018 24.0801Z" fill="white"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.9466 1.89697C7.72213 1.89697 1.84375 7.77539 1.84375 14.9999C1.84375 22.2253 7.72111 28.1027 14.9466 28.1027C22.1721 28.1027 28.0495 22.2253 28.0495 14.9999C28.0495 7.77539 22.1721 1.89697 14.9466 1.89697ZM21.2697 12.8385L13.7424 20.4476C13.7405 20.4495 13.7368 20.4505 13.7348 20.4533C13.7321 20.4552 13.7321 20.4589 13.7292 20.4608C13.6691 20.519 13.5948 20.5548 13.5252 20.5943C13.4905 20.6139 13.4623 20.6441 13.4256 20.6582C13.3128 20.7034 13.1934 20.7268 13.0739 20.7268C12.9536 20.7268 12.8324 20.7034 12.7186 20.6563C12.681 20.6404 12.6509 20.6084 12.6152 20.5886C12.5456 20.5491 12.4733 20.5143 12.4131 20.4552C12.4112 20.4533 12.4102 20.4495 12.4083 20.4476C12.4065 20.4448 12.4027 20.4448 12.4009 20.4419L8.69884 16.6374C8.33693 16.2652 8.34538 15.6702 8.71764 15.3082C9.08987 14.9472 9.684 14.9538 10.0469 15.3271L13.0805 18.4443L19.9337 11.5159C20.2985 11.1465 20.8945 11.1428 21.2631 11.5084C21.6305 11.874 21.6343 12.4692 21.2697 12.8385Z" fill="#24C790"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="142" height="40" viewBox="0 0 142 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 0H142L132.921 27.6208C130.493 35.0074 123.596 40 115.821 40H26.179C18.4036 40 11.5071 35.0074 9.07906 27.6208L0 0Z" fill="#F1631C"/>
3
+ <path d="M38.1398 8.47773L38.1727 8.47773C39.1898 8.48867 40.2098 8.48867 41.2297 8.48867L42.7855 8.48867C43.8246 8.48867 44.8637 8.48867 45.9055 8.50234C46.4824 8.51875 47.0512 8.63906 47.5871 8.85781C48.4977 9.21328 49.0172 10.0062 49.0145 11.0371L49.0117 14.9035C49.0117 17.0445 49.0117 19.1883 48.9926 21.3293C48.9898 21.9117 48.6152 22.4586 48.2953 22.7457C47.0566 23.8777 45.7113 25.2887 45.148 27.1918C44.9922 27.7223 44.932 28.3074 44.8691 28.9254C44.7434 30.1559 43.9449 30.957 42.8785 30.957C42.4602 30.957 42.0418 30.8312 41.6316 30.5879C40.8086 30.093 40.259 29.3164 39.9555 28.209C39.4688 26.4508 39.7176 24.7445 39.991 23.2816L39.991 23.2762C40.0539 22.9344 39.7969 22.6172 39.4469 22.6172L35.8922 22.6172C35.2797 22.6172 34.402 22.5406 33.8605 21.8844C33.4668 21.4059 33.3547 20.7605 33.5215 19.9074C34.0301 17.2852 34.6535 14.641 35.2496 12.1773C35.4355 11.409 35.7445 10.698 36.0426 10.009L36.1711 9.71367C36.5102 8.91523 37.2102 8.47773 38.1398 8.47773ZM53.384 8.73477L53.7094 8.73477C54.8852 8.73477 55.8477 9.69727 55.8477 10.873L55.8477 20.4023C55.8477 21.5781 54.8852 22.5406 53.7094 22.5406L53.384 22.5406C52.2082 22.5406 51.2457 21.5781 51.2457 20.4023L51.2457 10.8758C51.243 9.69727 52.2055 8.73477 53.384 8.73477Z" fill="white"/>
4
+ <path d="M79.5117 22.2832H82.4316C82.373 23.2402 82.1094 24.0898 81.6406 24.832C81.1784 25.5742 80.5306 26.1536 79.6973 26.5703C78.8704 26.987 77.8743 27.1953 76.709 27.1953C75.7975 27.1953 74.9805 27.0391 74.2578 26.7266C73.5352 26.4076 72.9167 25.9518 72.4023 25.3594C71.8945 24.7669 71.5072 24.0508 71.2402 23.2109C70.9733 22.3711 70.8398 21.4303 70.8398 20.3887V19.4023C70.8398 18.3607 70.9766 17.4199 71.25 16.5801C71.5299 15.7337 71.9271 15.0143 72.4414 14.4219C72.9622 13.8294 73.584 13.3737 74.3066 13.0547C75.0293 12.7357 75.8366 12.5762 76.7285 12.5762C77.9134 12.5762 78.9128 12.791 79.7266 13.2207C80.5469 13.6504 81.1816 14.2428 81.6309 14.998C82.0866 15.7533 82.36 16.6126 82.4512 17.5762H79.5215C79.4889 17.0033 79.375 16.5182 79.1797 16.1211C78.9844 15.7174 78.6882 15.4147 78.291 15.2129C77.9004 15.0046 77.3796 14.9004 76.7285 14.9004C76.2402 14.9004 75.8138 14.9915 75.4492 15.1738C75.0846 15.3561 74.7786 15.6328 74.5312 16.0039C74.2839 16.375 74.0983 16.8438 73.9746 17.4102C73.8574 17.9701 73.7988 18.6276 73.7988 19.3828V20.3887C73.7988 21.1243 73.8542 21.7721 73.9648 22.332C74.0755 22.8854 74.2448 23.3542 74.4727 23.7383C74.707 24.1159 75.0065 24.4023 75.3711 24.5977C75.7422 24.7865 76.1882 24.8809 76.709 24.8809C77.321 24.8809 77.8255 24.7832 78.2227 24.5879C78.6198 24.3926 78.9225 24.1029 79.1309 23.7188C79.3457 23.3346 79.4727 22.8561 79.5117 22.2832ZM83.7305 21.8242V21.6191C83.7305 20.8444 83.8411 20.1315 84.0625 19.4805C84.2839 18.8229 84.6061 18.2533 85.0293 17.7715C85.4525 17.2897 85.9733 16.9154 86.5918 16.6484C87.2103 16.375 87.9199 16.2383 88.7207 16.2383C89.5215 16.2383 90.2344 16.375 90.8594 16.6484C91.4844 16.9154 92.0085 17.2897 92.4316 17.7715C92.8613 18.2533 93.1868 18.8229 93.4082 19.4805C93.6296 20.1315 93.7402 20.8444 93.7402 21.6191V21.8242C93.7402 22.5924 93.6296 23.3053 93.4082 23.9629C93.1868 24.6139 92.8613 25.1836 92.4316 25.6719C92.0085 26.1536 91.4876 26.528 90.8691 26.7949C90.2507 27.0618 89.541 27.1953 88.7402 27.1953C87.9395 27.1953 87.2266 27.0618 86.6016 26.7949C85.9831 26.528 85.459 26.1536 85.0293 25.6719C84.6061 25.1836 84.2839 24.6139 84.0625 23.9629C83.8411 23.3053 83.7305 22.5924 83.7305 21.8242ZM86.543 21.6191V21.8242C86.543 22.2669 86.582 22.6803 86.6602 23.0645C86.7383 23.4486 86.862 23.7871 87.0312 24.0801C87.207 24.3665 87.4349 24.5911 87.7148 24.7539C87.9948 24.9167 88.3366 24.998 88.7402 24.998C89.1309 24.998 89.4661 24.9167 89.7461 24.7539C90.026 24.5911 90.2507 24.3665 90.4199 24.0801C90.5892 23.7871 90.7129 23.4486 90.791 23.0645C90.8757 22.6803 90.918 22.2669 90.918 21.8242V21.6191C90.918 21.1895 90.8757 20.7858 90.791 20.4082C90.7129 20.0241 90.5859 19.6855 90.4102 19.3926C90.2409 19.0931 90.0163 18.8587 89.7363 18.6895C89.4564 18.5202 89.1178 18.4355 88.7207 18.4355C88.3236 18.4355 87.985 18.5202 87.7051 18.6895C87.4316 18.8587 87.207 19.0931 87.0312 19.3926C86.862 19.6855 86.7383 20.0241 86.6602 20.4082C86.582 20.7858 86.543 21.1895 86.543 21.6191ZM98.2227 18.6895V27H95.4102V16.4336H98.0469L98.2227 18.6895ZM97.8125 21.3457H97.0508C97.0508 20.5645 97.1517 19.8613 97.3535 19.2363C97.5553 18.6048 97.8385 18.0677 98.2031 17.625C98.5677 17.1758 99.0007 16.834 99.502 16.5996C100.01 16.3587 100.576 16.2383 101.201 16.2383C101.696 16.2383 102.148 16.3099 102.559 16.4531C102.969 16.5964 103.32 16.8242 103.613 17.1367C103.913 17.4492 104.141 17.8626 104.297 18.377C104.46 18.8913 104.541 19.5195 104.541 20.2617V27H101.709V20.252C101.709 19.7832 101.644 19.4186 101.514 19.1582C101.383 18.8978 101.191 18.7155 100.938 18.6113C100.69 18.5007 100.384 18.4453 100.02 18.4453C99.6419 18.4453 99.3132 18.5202 99.0332 18.6699C98.7598 18.8197 98.5319 19.028 98.3496 19.2949C98.1738 19.5553 98.0404 19.8613 97.9492 20.2129C97.8581 20.5645 97.8125 20.9421 97.8125 21.3457ZM112.393 24.0801C112.393 23.8783 112.334 23.696 112.217 23.5332C112.1 23.3704 111.882 23.2207 111.562 23.084C111.25 22.9408 110.798 22.8105 110.205 22.6934C109.671 22.5762 109.173 22.4297 108.711 22.2539C108.255 22.0716 107.858 21.8535 107.52 21.5996C107.188 21.3457 106.927 21.0462 106.738 20.7012C106.549 20.3496 106.455 19.9492 106.455 19.5C106.455 19.0573 106.549 18.6406 106.738 18.25C106.934 17.8594 107.21 17.5143 107.568 17.2148C107.933 16.9089 108.376 16.6712 108.896 16.502C109.424 16.3262 110.016 16.2383 110.674 16.2383C111.592 16.2383 112.38 16.3848 113.037 16.6777C113.701 16.9707 114.209 17.3743 114.561 17.8887C114.919 18.3965 115.098 18.9759 115.098 19.627H112.285C112.285 19.3535 112.227 19.1094 112.109 18.8945C111.999 18.6732 111.823 18.5007 111.582 18.377C111.348 18.2467 111.042 18.1816 110.664 18.1816C110.352 18.1816 110.081 18.237 109.854 18.3477C109.626 18.4518 109.45 18.5951 109.326 18.7773C109.209 18.9531 109.15 19.1484 109.15 19.3633C109.15 19.526 109.183 19.6725 109.248 19.8027C109.32 19.9264 109.434 20.0404 109.59 20.1445C109.746 20.2487 109.948 20.3464 110.195 20.4375C110.449 20.5221 110.762 20.6003 111.133 20.6719C111.895 20.8281 112.575 21.0332 113.174 21.2871C113.773 21.5345 114.248 21.873 114.6 22.3027C114.951 22.7259 115.127 23.2826 115.127 23.9727C115.127 24.4414 115.023 24.8711 114.814 25.2617C114.606 25.6523 114.307 25.9941 113.916 26.2871C113.525 26.5736 113.057 26.7982 112.51 26.9609C111.969 27.1172 111.361 27.1953 110.684 27.1953C109.701 27.1953 108.867 27.0195 108.184 26.668C107.507 26.3164 106.992 25.8704 106.641 25.3301C106.296 24.7832 106.123 24.2233 106.123 23.6504H108.789C108.802 24.0345 108.9 24.3438 109.082 24.5781C109.271 24.8125 109.508 24.9818 109.795 25.0859C110.088 25.1901 110.404 25.2422 110.742 25.2422C111.107 25.2422 111.41 25.1934 111.65 25.0957C111.891 24.9915 112.074 24.8548 112.197 24.6855C112.327 24.5098 112.393 24.3079 112.393 24.0801Z" fill="white"/>
5
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_918_3041)">
3
+ <path d="M15 1.875C7.75137 1.875 1.875 7.75137 1.875 15C1.875 22.2486 7.75137 28.125 15 28.125C22.2486 28.125 28.125 22.2486 28.125 15C28.125 7.75137 22.2486 1.875 15 1.875ZM21.2988 19.8062C21.4962 20.0044 21.607 20.2728 21.607 20.5525C21.607 20.8322 21.4962 21.1006 21.2988 21.2988C21.1006 21.4958 20.8325 21.6064 20.5531 21.6064C20.2736 21.6064 20.0055 21.4958 19.8073 21.2988L15 16.4915L10.1953 21.2988C9.997 21.4966 9.72833 21.6077 9.44824 21.6077C9.16815 21.6077 8.89949 21.4966 8.70117 21.2988C8.50418 21.1006 8.39361 20.8325 8.39361 20.5531C8.39361 20.2736 8.50418 20.0055 8.70117 19.8073L13.5059 15.0026L8.70117 10.1953C8.50338 9.997 8.3923 9.72833 8.3923 9.44824C8.3923 9.16815 8.50338 8.89949 8.70117 8.70117C8.89949 8.50338 9.16815 8.3923 9.44824 8.3923C9.72833 8.3923 9.997 8.50338 10.1953 8.70117L15 13.5085L19.8047 8.70381C20.0027 8.50566 20.2711 8.39411 20.5512 8.39362C20.8313 8.39312 21.1002 8.50373 21.2988 8.70117C21.4966 8.89949 21.6077 9.16815 21.6077 9.44824C21.6077 9.72833 21.4966 9.997 21.2988 10.1953L16.4915 15L21.2988 19.8062Z" fill="#F1631C"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_918_3041">
7
+ <rect width="30" height="30" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_918_3068)">
3
+ <path d="M19 38C8.50615 38 0 29.4924 0 19C0 8.50615 8.50615 0 19 0C29.4938 0 38 8.50615 38 19C38 29.4924 29.4938 38 19 38ZM19 2.92162C10.1212 2.92162 2.92308 10.1197 2.92308 19C2.92308 27.8788 10.1212 35.0769 19 35.0769C27.8788 35.0769 35.0769 27.8788 35.0769 19C35.0769 10.1197 27.8788 2.92162 19 2.92162ZM24.1168 16.986C23.7412 17.4668 23.3364 17.8922 22.9038 18.2634C22.4712 18.6346 22.0663 19.0058 21.6907 19.3771C21.3151 19.7483 21.0023 20.1327 20.7553 20.5332C20.5083 20.9322 20.3841 21.375 20.3841 21.8602C20.3841 22.2695 20.4367 22.6407 20.5419 22.9739C20.6457 23.3072 20.7509 23.5878 20.8562 23.8158H17.8439C17.7577 23.5775 17.6817 23.2692 17.6159 22.8877C17.5487 22.5077 17.5151 22.1321 17.5151 21.7608C17.5151 21.1806 17.632 20.6545 17.8658 20.1838C18.0982 19.7118 18.3891 19.2718 18.7355 18.8626C19.0833 18.4534 19.4589 18.0588 19.8638 17.6788C20.2672 17.2973 20.6442 16.9261 20.9906 16.5651C21.3385 16.2041 21.6278 15.8226 21.8617 15.4236C22.0941 15.0232 22.211 14.5862 22.211 14.1097C22.211 13.6815 22.1262 13.3088 21.9538 12.9902C21.7828 12.6715 21.5475 12.4041 21.2478 12.1907C20.9482 11.9758 20.6062 11.8165 20.2204 11.7128C19.8345 11.6075 19.4238 11.5549 18.9854 11.5549C17.5677 11.5549 16.2172 12.1878 14.9325 13.4535V10.1562C16.492 9.24277 18.1099 8.78677 19.7848 8.78677C20.5551 8.78677 21.2844 8.88615 21.9684 9.08638C22.6538 9.28662 23.2531 9.58039 23.7675 9.97062C24.2805 10.3608 24.6854 10.8461 24.9806 11.4263C25.2758 12.008 25.4235 12.6832 25.4235 13.4535C25.4235 14.1857 25.2992 14.8375 25.0522 15.409C24.8038 15.9805 24.4925 16.5052 24.1168 16.986ZM19.4706 26.0417C20.0128 26.0417 20.4893 26.2332 20.8985 26.6132C21.2975 26.9654 21.4978 27.4126 21.4978 27.9548C21.4978 28.4883 21.2975 28.9355 20.8985 29.2965C20.4791 29.6678 20.0041 29.8534 19.4706 29.8534C18.9284 29.8534 18.4475 29.6678 18.0295 29.2965C17.6291 28.9355 17.4303 28.4883 17.4303 27.9548C17.4303 27.4126 17.6291 26.9654 18.0295 26.6132C18.4388 26.2332 18.9196 26.0417 19.4706 26.0417Z" fill="#F1981C"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_918_3068">
7
+ <rect width="38" height="38" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,30 @@
1
+ import { type Ref } from 'vue';
2
+ export interface UseInlineEditOptions {
3
+ /** 是否处于编辑器模式 */
4
+ editorMode: () => boolean;
5
+ /** 当 Section setting 编辑完成时调用 */
6
+ onSettingUpdate?: (key: string, value: string) => void;
7
+ /** 当 Block setting 编辑完成时调用 */
8
+ onBlockSettingUpdate?: (blockId: string, key: string, value: string) => void;
9
+ /** 内联编辑开始时调用 */
10
+ onEditStart?: (key: string) => void;
11
+ /** 内联编辑结束时调用 */
12
+ onEditEnd?: () => void;
13
+ /** 编辑中按 Ctrl+Z/Y 时调用(先提交编辑再触发,让 admin 执行 undo/redo) */
14
+ onUndoRedo?: (action: 'redo' | 'undo') => void;
15
+ }
16
+ export interface UseInlineEditReturn {
17
+ /** 绑定到可编辑的 Section setting 元素 */
18
+ editableAttrs: (settingKey: string) => Record<string, unknown>;
19
+ /** 绑定到可编辑的 Block setting 元素 */
20
+ blockEditableAttrs: (blockId: string, settingKey: string) => Record<string, unknown>;
21
+ /** 当前正在编辑的 key(null = 未编辑) */
22
+ editingKey: Ref<string | null>;
23
+ }
24
+ /**
25
+ * 内联编辑 composable
26
+ * 封装 contentEditable 逻辑,让 Section 组件在 editorMode 下支持双击编辑文本
27
+ *
28
+ * 设计思路:通过返回 attrs 对象配合 v-bind 使用,组件无需关心编辑状态管理
29
+ */
30
+ export declare function useInlineEdit(options: UseInlineEditOptions): UseInlineEditReturn;
@@ -0,0 +1,94 @@
1
+ import { detectUndoRedo } from "@vigilkids/section-core";
2
+ import { nextTick, ref } from "vue";
3
+ export function useInlineEdit(options) {
4
+ const { editorMode, onSettingUpdate, onBlockSettingUpdate, onEditStart, onEditEnd, onUndoRedo } = options;
5
+ const editingKey = ref(null);
6
+ let originalText = "";
7
+ function selectAllText(el) {
8
+ const selection = window.getSelection();
9
+ if (!selection) return;
10
+ const range = document.createRange();
11
+ range.selectNodeContents(el);
12
+ selection.removeAllRanges();
13
+ selection.addRange(range);
14
+ }
15
+ function startEdit(compositeKey, el) {
16
+ editingKey.value = compositeKey;
17
+ originalText = el.textContent ?? "";
18
+ onEditStart?.(compositeKey);
19
+ void nextTick(() => {
20
+ el.focus();
21
+ selectAllText(el);
22
+ });
23
+ }
24
+ function commitEdit(el, emitFn) {
25
+ const newValue = el.textContent?.trim() ?? "";
26
+ if (newValue !== originalText) {
27
+ emitFn(newValue);
28
+ }
29
+ editingKey.value = null;
30
+ onEditEnd?.();
31
+ }
32
+ function cancelEdit(el) {
33
+ el.textContent = originalText;
34
+ editingKey.value = null;
35
+ onEditEnd?.();
36
+ }
37
+ function buildAttrs(compositeKey, emitFn) {
38
+ if (!editorMode()) return {};
39
+ if (editingKey.value === compositeKey) {
40
+ return {
41
+ contenteditable: "plaintext-only",
42
+ class: "inline-editing",
43
+ onBlur: (e) => {
44
+ commitEdit(e.currentTarget, emitFn);
45
+ },
46
+ onKeydown: (e) => {
47
+ if (e.key === "Enter") {
48
+ e.preventDefault();
49
+ commitEdit(e.currentTarget, emitFn);
50
+ return;
51
+ }
52
+ if (e.key === "Escape") {
53
+ e.preventDefault();
54
+ cancelEdit(e.currentTarget);
55
+ return;
56
+ }
57
+ const undoRedoAction = detectUndoRedo(e);
58
+ if (undoRedoAction) {
59
+ e.preventDefault();
60
+ commitEdit(e.currentTarget, emitFn);
61
+ onUndoRedo?.(undoRedoAction);
62
+ }
63
+ },
64
+ onPaste: (e) => {
65
+ e.preventDefault();
66
+ const text = e.clipboardData?.getData("text/plain") ?? "";
67
+ document.execCommand("insertText", false, text);
68
+ }
69
+ };
70
+ }
71
+ return {
72
+ class: "inline-editable",
73
+ onDblclick: (e) => {
74
+ startEdit(compositeKey, e.currentTarget);
75
+ }
76
+ };
77
+ }
78
+ function editableAttrs(settingKey) {
79
+ return buildAttrs(settingKey, (newValue) => {
80
+ onSettingUpdate?.(settingKey, newValue);
81
+ });
82
+ }
83
+ function blockEditableAttrs(blockId, settingKey) {
84
+ const compositeKey = `${blockId}:${settingKey}`;
85
+ return buildAttrs(compositeKey, (newValue) => {
86
+ onBlockSettingUpdate?.(blockId, settingKey, newValue);
87
+ });
88
+ }
89
+ return {
90
+ editableAttrs,
91
+ blockEditableAttrs,
92
+ editingKey
93
+ };
94
+ }
@@ -0,0 +1,18 @@
1
+ import type { Ref } from 'vue';
2
+ interface LazyRenderOptions {
3
+ /** IntersectionObserver rootMargin,提前多少像素开始加载 */
4
+ rootMargin?: string;
5
+ /** 是否在 SSR 时直接渲染(不延迟),保证服务端输出完整 HTML */
6
+ ssrEager?: boolean;
7
+ }
8
+ /**
9
+ * 使用 IntersectionObserver 实现懒渲染
10
+ * 组件进入视口(或接近视口)时才触发渲染,减少首屏渲染负担
11
+ *
12
+ * SSR 环境下默认立即标记为可见,保证 HTML 完整性;
13
+ * 客户端 hydration 后由 IntersectionObserver 接管可见性判断
14
+ */
15
+ export declare function useLazyRender(targetRef: Ref<HTMLElement | null>, options?: LazyRenderOptions): {
16
+ isVisible: Ref<boolean, boolean>;
17
+ };
18
+ export {};
@@ -0,0 +1,33 @@
1
+ import { onMounted, onUnmounted, ref } from "vue";
2
+ export function useLazyRender(targetRef, options = {}) {
3
+ const { rootMargin = "200px", ssrEager = true } = options;
4
+ const isVisible = ref(typeof window === "undefined" ? ssrEager : false);
5
+ let observer = null;
6
+ onMounted(() => {
7
+ if (isVisible.value) return;
8
+ const el = targetRef.value;
9
+ if (!el) {
10
+ isVisible.value = true;
11
+ return;
12
+ }
13
+ observer = new IntersectionObserver(
14
+ (entries) => {
15
+ for (const entry of entries) {
16
+ if (entry.isIntersecting) {
17
+ isVisible.value = true;
18
+ observer?.disconnect();
19
+ observer = null;
20
+ break;
21
+ }
22
+ }
23
+ },
24
+ { rootMargin }
25
+ );
26
+ observer.observe(el);
27
+ });
28
+ onUnmounted(() => {
29
+ observer?.disconnect();
30
+ observer = null;
31
+ });
32
+ return { isVisible };
33
+ }
@@ -0,0 +1,38 @@
1
+ import type { Component } from 'vue';
2
+ import type { SectionRegistration } from '@vigilkids/section-core';
3
+ import { defineAsyncComponent } from 'vue';
4
+ /** Vue 组件工厂函数 */
5
+ type ComponentFactory = () => Promise<{
6
+ default: Component;
7
+ } | Component>;
8
+ /** 扩展注册信息(包含 Vue 组件工厂) */
9
+ interface VueSectionRegistration extends SectionRegistration {
10
+ component: ComponentFactory;
11
+ }
12
+ /** Vue 适配的 Section 注册表 */
13
+ declare class VueSectionRegistry {
14
+ private core;
15
+ private components;
16
+ private frozen;
17
+ /** 注册 Section 组件(可选 productCode 用于产品级覆盖) */
18
+ register(registration: VueSectionRegistration & {
19
+ productCode?: string;
20
+ }): void;
21
+ /** 解析组件 — 优先匹配产品级组件,回退到共享组件 */
22
+ resolve(type: string, productCode?: string): ReturnType<typeof defineAsyncComponent> | null;
23
+ /** 获取注册元数据 */
24
+ getRegistration(name: string): SectionRegistration | undefined;
25
+ /** 获取所有已注册组件名 */
26
+ names(): string[];
27
+ /** 冻结注册表 */
28
+ freeze(): void;
29
+ get isFrozen(): boolean;
30
+ get size(): number;
31
+ }
32
+ /** 获取注册表实例(Vue composable) */
33
+ export declare function useRegistry(): VueSectionRegistry;
34
+ /** 注册 Section 组件(全局函数,在模块 import 阶段调用) */
35
+ export declare function registerSection(registration: VueSectionRegistration & {
36
+ productCode?: string;
37
+ }): void;
38
+ export {};
@@ -0,0 +1,60 @@
1
+ import { defineAsyncComponent } from "vue";
2
+ import { SectionRegistryCore } from "@vigilkids/section-core";
3
+ import FallbackSection from "../renderer/FallbackSection.vue";
4
+ class VueSectionRegistry {
5
+ core = new SectionRegistryCore();
6
+ components = /* @__PURE__ */ new Map();
7
+ frozen = false;
8
+ /** 注册 Section 组件(可选 productCode 用于产品级覆盖) */
9
+ register(registration) {
10
+ if (this.frozen) {
11
+ throw new Error(`[SectionRegistry] Registry is frozen, cannot register "${registration.name}"`);
12
+ }
13
+ this.core.register(registration);
14
+ const key = registration.productCode ? `${registration.productCode}:${registration.name}` : registration.name;
15
+ this.components.set(
16
+ key,
17
+ defineAsyncComponent({
18
+ loader: registration.component,
19
+ loadingComponent: FallbackSection,
20
+ errorComponent: FallbackSection,
21
+ delay: 200,
22
+ timeout: 1e4
23
+ })
24
+ );
25
+ }
26
+ /** 解析组件 — 优先匹配产品级组件,回退到共享组件 */
27
+ resolve(type, productCode) {
28
+ if (productCode) {
29
+ const productComponent = this.components.get(`${productCode}:${type}`);
30
+ if (productComponent) return productComponent;
31
+ }
32
+ return this.components.get(type) ?? null;
33
+ }
34
+ /** 获取注册元数据 */
35
+ getRegistration(name) {
36
+ return this.core.get(name);
37
+ }
38
+ /** 获取所有已注册组件名 */
39
+ names() {
40
+ return this.core.names();
41
+ }
42
+ /** 冻结注册表 */
43
+ freeze() {
44
+ this.frozen = true;
45
+ this.core.freeze();
46
+ }
47
+ get isFrozen() {
48
+ return this.frozen;
49
+ }
50
+ get size() {
51
+ return this.core.size;
52
+ }
53
+ }
54
+ const registryInstance = new VueSectionRegistry();
55
+ export function useRegistry() {
56
+ return registryInstance;
57
+ }
58
+ export function registerSection(registration) {
59
+ registryInstance.register(registration);
60
+ }
@@ -0,0 +1,26 @@
1
+ import type { SectionsData } from '@vigilkids/section-core';
2
+ /** JSON-LD 结构化数据生成参数 */
3
+ export interface SectionSEOOptions {
4
+ /** 页面标题 */
5
+ title: string;
6
+ /** 页面描述 */
7
+ description: string;
8
+ /** 页面 URL (完整路径) */
9
+ url?: string;
10
+ /** 发布日期 ISO 格式 */
11
+ datePublished?: string;
12
+ /** 修改日期 ISO 格式 */
13
+ dateModified?: string;
14
+ /** 作者名称 */
15
+ author?: string;
16
+ }
17
+ /** 从 SectionsData 生成 JSON-LD 结构化数据 */
18
+ export declare function generateSectionJsonLd(sectionsData: SectionsData, options: SectionSEOOptions): Record<string, unknown>[];
19
+ /**
20
+ * 生成 JSON-LD script 标签内容
21
+ * 用于 SSR 场景下直接注入 <head>,兼容 Nuxt useHead() 的 script 格式
22
+ */
23
+ export declare function generateJsonLdScripts(sectionsData: SectionsData, options: SectionSEOOptions): Array<{
24
+ type: 'application/ld+json';
25
+ innerHTML: string;
26
+ }>;
@@ -0,0 +1,122 @@
1
+ function getOrderedBlocks(section) {
2
+ return (section.block_order ?? []).filter((id) => id in (section.blocks ?? {})).map((id) => ({
3
+ id,
4
+ settings: section.blocks[id]?.settings ?? {}
5
+ }));
6
+ }
7
+ function mapSectionToSchema(section) {
8
+ const settings = section.settings;
9
+ switch (section.type) {
10
+ case "hero-banner":
11
+ return {
12
+ "@type": "WPHeader",
13
+ "cssSelector": `[data-section-id="${section.id}"]`,
14
+ "headline": settings.heading ?? ""
15
+ };
16
+ case "feature-grid": {
17
+ const blocks = getOrderedBlocks(section);
18
+ return {
19
+ "@type": "ItemList",
20
+ "cssSelector": `[data-section-id="${section.id}"]`,
21
+ "numberOfItems": blocks.length,
22
+ "itemListElement": blocks.map((block, index) => ({
23
+ "@type": "ListItem",
24
+ "position": index + 1,
25
+ "name": block.settings.title ?? "",
26
+ "description": block.settings.description ?? ""
27
+ }))
28
+ };
29
+ }
30
+ case "testimonials": {
31
+ const blocks = getOrderedBlocks(section);
32
+ return {
33
+ "@type": "ItemList",
34
+ "cssSelector": `[data-section-id="${section.id}"]`,
35
+ "numberOfItems": blocks.length,
36
+ "itemListElement": blocks.map((block, index) => ({
37
+ "@type": "Review",
38
+ "position": index + 1,
39
+ "reviewBody": block.settings.quote ?? "",
40
+ "author": {
41
+ "@type": "Person",
42
+ "name": block.settings.author ?? ""
43
+ }
44
+ }))
45
+ };
46
+ }
47
+ case "text-with-image":
48
+ return {
49
+ "@type": "WebPageElement",
50
+ "cssSelector": `[data-section-id="${section.id}"]`,
51
+ "headline": settings.heading ?? "",
52
+ "text": settings.body ?? ""
53
+ };
54
+ case "cta":
55
+ return {
56
+ "@type": "WebPageElement",
57
+ "cssSelector": `[data-section-id="${section.id}"]`,
58
+ "headline": settings.heading ?? ""
59
+ };
60
+ case "rich-text":
61
+ return {
62
+ "@type": "Article",
63
+ "cssSelector": `[data-section-id="${section.id}"]`
64
+ };
65
+ // spacer 和 faq 不生成 hasPart 条目(faq 有独立 FAQPage schema)
66
+ default:
67
+ return null;
68
+ }
69
+ }
70
+ function generateFAQSchema(section) {
71
+ const blocks = getOrderedBlocks(section);
72
+ if (blocks.length === 0) return null;
73
+ return {
74
+ "@context": "https://schema.org",
75
+ "@type": "FAQPage",
76
+ "mainEntity": blocks.map((block) => ({
77
+ "@type": "Question",
78
+ "name": block.settings.question ?? "",
79
+ "acceptedAnswer": {
80
+ "@type": "Answer",
81
+ "text": block.settings.answer ?? ""
82
+ }
83
+ }))
84
+ };
85
+ }
86
+ export function generateSectionJsonLd(sectionsData, options) {
87
+ const schemas = [];
88
+ const orderedSections = sectionsData.section_order.map((id) => {
89
+ const section = sectionsData.sections[id];
90
+ return section ? { ...section, id } : void 0;
91
+ }).filter((s) => !!s && !s.disabled);
92
+ const webPage = {
93
+ "@context": "https://schema.org",
94
+ "@type": "WebPage",
95
+ "name": options.title,
96
+ "description": options.description
97
+ };
98
+ if (options.url) webPage.url = options.url;
99
+ if (options.datePublished) webPage.datePublished = options.datePublished;
100
+ if (options.dateModified) webPage.dateModified = options.dateModified;
101
+ if (options.author) {
102
+ webPage.author = { "@type": "Person", "name": options.author };
103
+ }
104
+ const parts = orderedSections.map((section) => mapSectionToSchema(section)).filter((p) => p !== null);
105
+ if (parts.length > 0) {
106
+ webPage.hasPart = parts;
107
+ }
108
+ schemas.push(webPage);
109
+ const faqSections = orderedSections.filter((s) => s.type === "faq");
110
+ for (const faq of faqSections) {
111
+ const faqSchema = generateFAQSchema(faq);
112
+ if (faqSchema) schemas.push(faqSchema);
113
+ }
114
+ return schemas;
115
+ }
116
+ export function generateJsonLdScripts(sectionsData, options) {
117
+ const schemas = generateSectionJsonLd(sectionsData, options);
118
+ return schemas.map((schema) => ({
119
+ type: "application/ld+json",
120
+ innerHTML: JSON.stringify(schema)
121
+ }));
122
+ }
@@ -0,0 +1,23 @@
1
+ import { type Ref } from 'vue';
2
+ export interface SectionStyleResult {
3
+ /** Tailwind class 列表(语义 token 映射) */
4
+ wrapperClasses: string;
5
+ /** 内联样式对象(raw 值覆盖) */
6
+ wrapperStyles: Record<string, string>;
7
+ /** Scoped CSS 文本(自定义间距 + custom_css) */
8
+ scopedCSS: string;
9
+ /** 自定义 class(用户输入的 custom_class) */
10
+ customClass: string;
11
+ }
12
+ /**
13
+ * Section 样式词汇表 composable
14
+ * 将 settings 中的约定字段自动映射为 CSS classes / inline styles / scoped CSS
15
+ *
16
+ * 三层样式覆盖:
17
+ * 1. 语义 Token → Tailwind class(spacing_preset, text_alignment, max_width, visibility)
18
+ * 2. Raw 值 → inline style / scoped CSS(background_color, text_color, border_radius, margin, padding)
19
+ * 3. Custom CSS → scoped style 注入(custom_css 逃生舱)
20
+ */
21
+ export declare function useSectionStyle(sectionId: string | Ref<string> | (() => string), settings: Record<string, unknown> | Ref<Record<string, unknown>> | (() => Record<string, unknown>)): {
22
+ style: Ref<SectionStyleResult>;
23
+ };