@nuxtjs/prismic 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -6
- package/dist/client/200.html +14 -0
- package/dist/client/404.html +14 -0
- package/dist/client/_nuxt/BFN9l5Uh.js +1 -0
- package/dist/client/_nuxt/C28ItRAc.js +1 -0
- package/dist/client/_nuxt/C2Zksehh.js +1 -0
- package/dist/client/_nuxt/Cc-k9tLd.js +1 -0
- package/dist/client/_nuxt/DWOr2Aml.js +29 -0
- package/dist/client/_nuxt/DiRqOYkY.js +2 -0
- package/dist/client/_nuxt/DlAUqK2U.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -0
- package/dist/client/_nuxt/builds/meta/ad9d6ff8-05cb-4470-a389-47d551f276c8.json +1 -0
- package/dist/client/_nuxt/builds/meta/dev.json +1 -0
- package/dist/client/_nuxt/entry.CDGvsxww.css +1 -0
- package/dist/client/_nuxt/error-404.CA6XZ6nY.css +1 -0
- package/dist/client/_nuxt/error-500.DPwYA3kH.css +1 -0
- package/dist/client/_nuxt/index.ofkS6DTB.css +1 -0
- package/dist/client/index.html +14 -0
- package/dist/module.d.mts +6 -0
- package/dist/module.d.ts +6 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +117 -9
- package/dist/runtime/plugin.mjs +7 -3
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +29 -13
- package/src/devtools/index.ts +124 -0
- package/src/devtools/types.ts +22 -0
- package/src/module.ts +11 -5
- package/src/runtime/plugin.ts +8 -4
- package/src/types.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"ad9d6ff8-05cb-4470-a389-47d551f276c8","timestamp":1712585048360,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"dev","timestamp":1712585049315,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--nui-c-context: 125, 125, 125}html{background-color:#fff}html.dark{background-color:#151515;color:#fff;color-scheme:dark}::-moz-selection{background:#8884}::selection{background:#8884}.shiki .line{display:inline-block;position:relative;width:100%}.shiki.diff .line>span{filter:saturate(.75);opacity:.75}.shiki.diff .line-added,.shiki.diff .line-removed{scroll-margin:5em}.shiki.diff .line-added>span,.shiki.diff .line-removed>span{opacity:1!important;position:inherit;scroll-margin:20px;z-index:100}.shiki.diff .line-added>span{color:#218c3b!important}.shiki.diff .line-removed>span{color:#d15547!important}.shiki .line-added:after{background-color:#43885420;bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.shiki .line-removed:after{background-color:#8f4c3926;bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}::view-transition-new(root),::view-transition-old(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:2147483646}.dark::view-transition-old(root){z-index:2147483646}.dark::view-transition-new(root){z-index:1}*,:after,:before{border-color:var(--un-default-border-color, #e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content: ""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-display:swap;font-family:DM Mono;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthSQBLyM.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:DM Mono;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthqQBA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:DM Sans;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232VGM.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:DM Sans;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.carbon-chevron-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z'/%3E%3C/svg%3E");background-color:currentColor;color:inherit;display:inline-block;height:1.2em;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;vertical-align:middle;width:1.2em}.carbon\:settings{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M27 16.76v-1.53l1.92-1.68A2 2 0 0 0 29.3 11l-2.36-4a2 2 0 0 0-1.73-1a2 2 0 0 0-.64.1l-2.43.82a11.35 11.35 0 0 0-1.31-.75l-.51-2.52a2 2 0 0 0-2-1.61h-4.68a2 2 0 0 0-2 1.61l-.51 2.52a11.48 11.48 0 0 0-1.32.75l-2.38-.86A2 2 0 0 0 6.79 6a2 2 0 0 0-1.73 1L2.7 11a2 2 0 0 0 .41 2.51L5 15.24v1.53l-1.89 1.68A2 2 0 0 0 2.7 21l2.36 4a2 2 0 0 0 1.73 1a2 2 0 0 0 .64-.1l2.43-.82a11.35 11.35 0 0 0 1.31.75l.51 2.52a2 2 0 0 0 2 1.61h4.72a2 2 0 0 0 2-1.61l.51-2.52a11.48 11.48 0 0 0 1.32-.75l2.42.82a2 2 0 0 0 .64.1a2 2 0 0 0 1.73-1l2.28-4a2 2 0 0 0-.41-2.51ZM25.21 24l-3.43-1.16a8.86 8.86 0 0 1-2.71 1.57L18.36 28h-4.72l-.71-3.55a9.36 9.36 0 0 1-2.7-1.57L6.79 24l-2.36-4l2.72-2.4a8.9 8.9 0 0 1 0-3.13L4.43 12l2.36-4l3.43 1.16a8.86 8.86 0 0 1 2.71-1.57L13.64 4h4.72l.71 3.55a9.36 9.36 0 0 1 2.7 1.57L25.21 8l2.36 4l-2.72 2.4a8.9 8.9 0 0 1 0 3.13L27.57 20Z'/%3E%3Cpath fill='currentColor' d='M16 22a6 6 0 1 1 6-6a5.94 5.94 0 0 1-6 6m0-10a3.91 3.91 0 0 0-4 4a3.91 3.91 0 0 0 4 4a3.91 3.91 0 0 0 4-4a3.91 3.91 0 0 0-4-4'/%3E%3C/svg%3E");background-color:currentColor;color:inherit;display:inline-block;height:1.2em;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;vertical-align:middle;width:1.2em}.i-logos\:prismic-icon{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 256 256' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath fill='%23E55638' d='M222.777 8.548a58.09 58.09 0 0 1 24.135 24.192c5.568 10.432 8.533 20.778 8.533 49.3v50.099a1.6 1.6 0 0 1-2.73 1.13v-.007l-18.88-18.915a8.007 8.007 0 0 1-2.34-5.66V85.531c0-21.397-2.226-29.155-6.4-36.977a43.57 43.57 0 0 0-18.105-18.14c-7.719-4.145-15.382-6.368-36.223-6.414h-31.211a1.6 1.6 0 0 1-1.124-2.73l18.88-18.923A7.97 7.97 0 0 1 162.958 0h10.617c28.466 0 38.791 2.972 49.202 8.548M183.602 40c17.635 0 31.929 14.329 31.929 32v20.26a1.6 1.6 0 0 1-2.703 1.152L187.086 68.75a15.93 15.93 0 0 0-5.824-3.719A15.9 15.9 0 0 0 175.616 64h-75.99a1.6 1.6 0 0 1-1.13-2.73l18.908-18.93a7.977 7.977 0 0 1 5.64-2.34z'/%3E%3Cpath fill='%23F4C942' d='m234.219 138.738l18.887 18.922a8.04 8.04 0 0 1 2.34 5.66v10.646c0 28.523-2.966 38.87-8.534 49.302a58.09 58.09 0 0 1-24.135 24.192c-10.41 5.568-20.736 8.54-49.202 8.54h-49.984a1.6 1.6 0 0 1-1.123-2.73v.006l18.88-18.922a7.97 7.97 0 0 1 5.646-2.347h23.104c21.347 0 29.084-2.226 36.892-6.414a43.57 43.57 0 0 0 18.105-18.14c4.174-7.823 6.4-15.581 6.4-36.978v-30.607a1.6 1.6 0 0 1 2.724-1.13M194.31 98.73l18.887 18.944a8.02 8.02 0 0 1 2.333 5.66v60.686c0 17.671-14.294 32-31.93 32h-20.216a1.6 1.6 0 0 1-1.152-2.702v-.007l24.604-25.806a15.898 15.898 0 0 0 3.72-5.831a16 16 0 0 0 1.023-5.654V99.86a1.6 1.6 0 0 1 2.731-1.13'/%3E%3Cpath fill='%237B8FEA' d='m2.724 122.73l18.894 18.923a8.04 8.04 0 0 1 2.34 5.66v23.155c0 21.397 2.218 29.155 6.4 36.977a43.57 43.57 0 0 0 18.097 18.14c7.808 4.19 15.552 6.415 36.9 6.415h30.535a1.6 1.6 0 0 1 1.138 2.73l-18.895 18.923A7.966 7.966 0 0 1 92.494 256H81.87c-28.466 0-38.784-2.972-49.194-8.548A58.09 58.09 0 0 1 8.533 223.26C3.021 212.933.06 202.69.001 174.81L0 123.86a1.6 1.6 0 0 1 2.724-1.13m39.893 39.858h-.007l25.756 24.662a15.904 15.904 0 0 0 5.817 3.719A15.792 15.792 0 0 0 79.83 192h75.99a1.6 1.6 0 0 1 1.123 2.73l-18.901 18.93a7.99 7.99 0 0 1-5.64 2.34H71.845a31.964 31.964 0 0 1-31.93-32v-20.26a1.6 1.6 0 0 1 2.703-1.152'/%3E%3Cpath fill='%23D97EE8' d='M92.06 40a1.6 1.6 0 0 1 1.152 2.702L68.601 68.516a15.879 15.879 0 0 0-3.712 5.83A16 16 0 0 0 63.858 80v76.16a1.6 1.6 0 0 1-2.724 1.124L42.247 138.34a8.007 8.007 0 0 1-2.332-5.654V72c0-17.671 14.293-32 31.929-32zm39.794-40a1.6 1.6 0 0 1 1.124 2.73l-18.88 18.923A7.983 7.983 0 0 1 108.452 24H85.348c-21.348 0-29.092 2.226-36.9 6.414a43.57 43.57 0 0 0-18.105 18.14c-4.13 7.74-6.353 15.418-6.4 36.307v31.278a1.6 1.6 0 0 1-2.723 1.13L2.347 98.347A8.004 8.004 0 0 1 0 92.687V82.04c0-28.522 2.965-38.87 8.533-49.3A58.09 58.09 0 0 1 32.668 8.548C42.975 3.028 53.198.06 81.015 0z'/%3E%3C/g%3E%3C/svg%3E") no-repeat;background-color:transparent;background-size:100% 100%;display:inline-block;height:1.2em;vertical-align:middle;width:1.2em}.n-button-icon{font-size:1.1em;margin-left:-.2em;margin-right:.2em}.n-icon-button{align-items:center;aspect-ratio:1/1;border-radius:.25rem;display:flex;height:1.6em;justify-content:center;opacity:.5;width:1.6em}.n-tip-base{align-items:center;background-color:rgba(var(--nui-c-context),.04);border-radius:.25rem;display:flex;gap:.5rem;padding:.4em 1em;--un-text-opacity:1;color:rgba(var(--nui-c-context),var(--un-text-opacity))}.n-button-base{align-items:center;border-color:#9ca3af33;border-radius:.25rem;border-width:1px;display:inline-flex;gap:.25rem;opacity:.8;padding:.25em 1em;touch-action:manipulation;--un-shadow:var(--un-shadow-inset) 0 1px 2px 0 var(--un-shadow-color, rgba(0,0,0,.05));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);outline:2px solid transparent!important;outline-offset:2px!important}.n-icon{flex:none}.n-card-base{border-color:#9ca3af33;border-radius:.25rem;border-width:1px;--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 1px 2px 0 var(--un-shadow-color, rgba(0,0,0,.05));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.hover\:n-button-hover:hover{--un-border-opacity:1 !important;border-color:rgba(var(--nui-c-context),var(--un-border-opacity))!important;--un-text-opacity:1;color:rgba(var(--nui-c-context),var(--un-text-opacity));opacity:1}.dark .n-bg-base,.dark .n-card-base{--un-bg-opacity:1;background-color:rgb(21 21 21 / var(--un-bg-opacity))}.n-bg-base,.n-code-block{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.dark .n-code-block{--un-bg-opacity:1;background-color:rgb(18 18 18 / var(--un-bg-opacity))}.dark .n-tip-base{background-color:rgba(var(--nui-c-context),.12)}.n-icon-button:hover{background-color:#9ca3af0d;opacity:1}.active\:n-button-active:active{background-color:rgba(var(--nui-c-context),.05);--un-ring-width:3px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-color:rgba(var(--nui-c-context),.1)}.focus-visible\:n-focus-base:focus-visible{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-color:rgba(var(--nui-c-context),.5)}.n-transition{transition-duration:.15s;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.relative{position:relative}.-bottom-1\/2{bottom:-50%}.left-0{left:0}.right-0{right:0}.z-10{z-index:10}.z-20{z-index:20}.grid{display:grid}.mb-16{margin-bottom:4rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mt-4{margin-top:1rem}.mt1{margin-top:.25rem}.inline-block{display:inline-block}.h-1\/2{height:50%}.h-auto{height:auto}.h-screen{height:100vh}.h1{height:.25rem}.h2{height:.5rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.w-full{width:100%}.flex,[flex~="~"]{display:flex}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-col{flex-direction:column}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer,[cursor-pointer=""]{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.place-content-center{place-content:center}.place-self-start,[place-self-start=""]{place-self:start}.items-center,[items-center=""]{align-items:center}.justify-center{justify-content:center}.flex-gap2,.gap-2{gap:.5rem}.gap-3,[flex~=gap-3]{gap:.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.border,[border=""]{border-width:1px}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.border-none{border-style:none}.bg-black\/5{background-color:#0000000d}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.dark .dark\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0 / var(--un-bg-opacity))}.dark .dark\:bg-white\/10{background-color:#ffffff1a}.p-4,.p4{padding:1rem}.p-8{padding:2rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-4,.px4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb6{padding-bottom:1.5rem}.pt-14{padding-top:3.5rem}.pt2{padding-top:.5rem}.text-center{text-align:center}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-8xl{font-size:6rem;line-height:1}.text-base,[text-base=""]{font-size:1rem;line-height:1.5rem}.text-sm,[text-sm=""]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.dark .dark\:text-white{--un-text-opacity:1;color:rgb(255 255 255 / var(--un-text-opacity))}.text-black{--un-text-opacity:1;color:rgb(0 0 0 / var(--un-text-opacity))}.text-truegray{--un-text-opacity:1;color:rgb(163 163 163 / var(--un-text-opacity))}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.leading-tight{line-height:1.25}.font-sans{font-family:DM Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.op100{opacity:1}.op50,[op50=""]{opacity:.5}.op60{opacity:.6}.op75,[op75=""]{opacity:.75}.hover\:op100:hover{opacity:1}.transition,[transition=""]{transition-duration:.15s;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500,[duration-500=""]{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[n~=green]{--nui-c-context:74,222,128}[n~=yellow]{--nui-c-context:250,204,21}.n-disabled\:n-disabled[disabled],[disabled] .n-disabled\:n-disabled{filter:saturate(0);opacity:.6;pointer-events:none}@media (min-width:640px){.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-8xl{font-size:6rem;line-height:1}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.spotlight[data-v-8e38b8ef]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);bottom:-30vh;filter:blur(20vh);height:40vh}.gradient-border[data-v-8e38b8ef]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:.5rem;position:relative}@media (prefers-color-scheme:light){.gradient-border[data-v-8e38b8ef]{background-color:#ffffff4d}.gradient-border[data-v-8e38b8ef]:before{background:linear-gradient(90deg,#e2e2e2,#e2e2e2 25%,#00dc82,#36e4da 75%,#0047e1)}}@media (prefers-color-scheme:dark){.gradient-border[data-v-8e38b8ef]{background-color:#1414144d}.gradient-border[data-v-8e38b8ef]:before{background:linear-gradient(90deg,#303030,#303030 25%,#00dc82,#36e4da 75%,#0047e1)}}.gradient-border[data-v-8e38b8ef]:before{background-size:400% auto;border-radius:.5rem;bottom:0;content:"";left:0;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5;padding:2px;position:absolute;right:0;top:0;transition:background-position .3s ease-in-out,opacity .2s ease-in-out;width:100%}.gradient-border[data-v-8e38b8ef]:hover:before{background-position:-50% 0;opacity:1}.bg-white[data-v-8e38b8ef]{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.cursor-pointer[data-v-8e38b8ef]{cursor:pointer}.flex[data-v-8e38b8ef]{display:flex}.grid[data-v-8e38b8ef]{display:grid}.place-content-center[data-v-8e38b8ef]{place-content:center}.items-center[data-v-8e38b8ef]{align-items:center}.justify-center[data-v-8e38b8ef]{justify-content:center}.font-sans[data-v-8e38b8ef]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-medium[data-v-8e38b8ef]{font-weight:500}.font-light[data-v-8e38b8ef]{font-weight:300}.text-8xl[data-v-8e38b8ef]{font-size:6rem;line-height:1}.text-xl[data-v-8e38b8ef]{font-size:1.25rem;line-height:1.75rem}.leading-tight[data-v-8e38b8ef]{line-height:1.25}.mb-8[data-v-8e38b8ef]{margin-bottom:2rem}.mb-16[data-v-8e38b8ef]{margin-bottom:4rem}.max-w-520px[data-v-8e38b8ef]{max-width:520px}.min-h-screen[data-v-8e38b8ef]{min-height:100vh}.overflow-hidden[data-v-8e38b8ef]{overflow:hidden}.px-8[data-v-8e38b8ef]{padding-left:2rem;padding-right:2rem}.py-2[data-v-8e38b8ef]{padding-bottom:.5rem;padding-top:.5rem}.px-4[data-v-8e38b8ef]{padding-left:1rem;padding-right:1rem}.fixed[data-v-8e38b8ef]{position:fixed}.left-0[data-v-8e38b8ef]{left:0}.right-0[data-v-8e38b8ef]{right:0}.text-center[data-v-8e38b8ef]{text-align:center}.text-black[data-v-8e38b8ef]{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.antialiased[data-v-8e38b8ef]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.w-full[data-v-8e38b8ef]{width:100%}.z-10[data-v-8e38b8ef]{z-index:10}.z-20[data-v-8e38b8ef]{z-index:20}@media (min-width:640px){.sm\:text-4xl[data-v-8e38b8ef]{font-size:2.25rem;line-height:2.5rem}.sm\:text-xl[data-v-8e38b8ef]{font-size:1.25rem;line-height:1.75rem}.sm\:text-10xl[data-v-8e38b8ef]{font-size:10rem;line-height:1}.sm\:px-0[data-v-8e38b8ef]{padding-left:0;padding-right:0}.sm\:py-3[data-v-8e38b8ef]{padding-bottom:.75rem;padding-top:.75rem}.sm\:px-6[data-v-8e38b8ef]{padding-left:1.5rem;padding-right:1.5rem}}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-8e38b8ef]{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.dark\:text-white[data-v-8e38b8ef]{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.spotlight[data-v-5741bfc2]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}.bg-white[data-v-5741bfc2]{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.grid[data-v-5741bfc2]{display:grid}.place-content-center[data-v-5741bfc2]{place-content:center}.font-sans[data-v-5741bfc2]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-medium[data-v-5741bfc2]{font-weight:500}.font-light[data-v-5741bfc2]{font-weight:300}.h-1\/2[data-v-5741bfc2]{height:50%}.text-8xl[data-v-5741bfc2]{font-size:6rem;line-height:1}.text-xl[data-v-5741bfc2]{font-size:1.25rem;line-height:1.75rem}.leading-tight[data-v-5741bfc2]{line-height:1.25}.mb-8[data-v-5741bfc2]{margin-bottom:2rem}.mb-16[data-v-5741bfc2]{margin-bottom:4rem}.max-w-520px[data-v-5741bfc2]{max-width:520px}.min-h-screen[data-v-5741bfc2]{min-height:100vh}.overflow-hidden[data-v-5741bfc2]{overflow:hidden}.px-8[data-v-5741bfc2]{padding-left:2rem;padding-right:2rem}.fixed[data-v-5741bfc2]{position:fixed}.left-0[data-v-5741bfc2]{left:0}.right-0[data-v-5741bfc2]{right:0}.-bottom-1\/2[data-v-5741bfc2]{bottom:-50%}.text-center[data-v-5741bfc2]{text-align:center}.text-black[data-v-5741bfc2]{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.antialiased[data-v-5741bfc2]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width:640px){.sm\:text-4xl[data-v-5741bfc2]{font-size:2.25rem;line-height:2.5rem}.sm\:text-10xl[data-v-5741bfc2]{font-size:10rem;line-height:1}.sm\:px-0[data-v-5741bfc2]{padding-left:0;padding-right:0}}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-5741bfc2]{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.dark\:text-white[data-v-5741bfc2]{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.n-code-block-lines .shiki code{counter-increment:step calc(var(--start, 1) - 1);counter-reset:step}.n-code-block-lines .shiki code .line:before{content:counter(step);counter-increment:step;display:inline-block;margin-right:.5rem;padding-right:.5rem;text-align:right;width:2.5rem;--at-apply: text-truegray: 50}details[data-v-041276db]{border-style:none}summary[data-v-041276db]{border-style:none;list-style:none}details[open] summary[data-v-041276db]{border-style:none}details summary[data-v-041276db]::-webkit-details-marker{display:none}details[open] .chevron[data-v-041276db]{opacity:.75;transform:rotate(180deg)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
+
<link rel="stylesheet" href="/__prismic-client/_nuxt/entry.CDGvsxww.css">
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__prismic-client/_nuxt/DWOr2Aml.js">
|
|
5
|
+
<link rel="prefetch" as="style" href="/__prismic-client/_nuxt/error-404.CA6XZ6nY.css">
|
|
6
|
+
<link rel="prefetch" as="script" crossorigin href="/__prismic-client/_nuxt/Cc-k9tLd.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__prismic-client/_nuxt/C2Zksehh.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__prismic-client/_nuxt/BFN9l5Uh.js">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__prismic-client/_nuxt/DlAUqK2U.js">
|
|
10
|
+
<link rel="prefetch" as="style" href="/__prismic-client/_nuxt/error-500.DPwYA3kH.css">
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__prismic-client/_nuxt/C28ItRAc.js">
|
|
12
|
+
<script type="module" src="/__prismic-client/_nuxt/DWOr2Aml.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,c=window.localStorage,d=["dark","light"],n=c&&c.getItem&&c.getItem("nuxt-color-mode")||"system";let l=n==="system"?f():n;const i=e.getAttribute("data-color-mode-forced");i&&(l=i),r(l),a["__NUXT_COLOR_MODE__"]={preference:n,value:l,getColorScheme:f,addColorScheme:r,removeColorScheme:u};function r(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function u(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function m(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&m("").media!=="not all"){for(const o of d)if(m(":"+o).matches)return o}return"light"}})();
|
|
13
|
+
</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
|
14
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__prismic-client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -81,6 +81,12 @@ type PrismicModuleOptions = Omit<PrismicPluginOptions, 'endpoint' | 'client' | '
|
|
|
81
81
|
* @defaultValue `true`
|
|
82
82
|
*/
|
|
83
83
|
toolbar?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Whether or not to enable the devtools UI.
|
|
86
|
+
*
|
|
87
|
+
* @defaultValue `true`
|
|
88
|
+
*/
|
|
89
|
+
devtools?: boolean;
|
|
84
90
|
};
|
|
85
91
|
|
|
86
92
|
declare module '@nuxt/schema' {
|
package/dist/module.d.ts
CHANGED
|
@@ -81,6 +81,12 @@ type PrismicModuleOptions = Omit<PrismicPluginOptions, 'endpoint' | 'client' | '
|
|
|
81
81
|
* @defaultValue `true`
|
|
82
82
|
*/
|
|
83
83
|
toolbar?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Whether or not to enable the devtools UI.
|
|
86
|
+
*
|
|
87
|
+
* @defaultValue `true`
|
|
88
|
+
*/
|
|
89
|
+
devtools?: boolean;
|
|
84
90
|
};
|
|
85
91
|
|
|
86
92
|
declare module '@nuxt/schema' {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,8 +2,113 @@ import { join } from 'node:path';
|
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { defineNuxtModule, createResolver, addPlugin, addComponent, addImports, extendPages, addTemplate } from '@nuxt/kit';
|
|
4
4
|
import * as prismicVue from '@prismicio/vue';
|
|
5
|
-
import { consola } from 'consola';
|
|
6
5
|
import { existsSync } from 'node:fs';
|
|
6
|
+
import { onDevToolsInitialized, extendServerRpc, startSubprocess } from '@nuxt/devtools-kit';
|
|
7
|
+
import { resolve } from 'pathe';
|
|
8
|
+
import terminate from 'terminate';
|
|
9
|
+
import { consola } from 'consola';
|
|
10
|
+
|
|
11
|
+
const RPC_NAMESPACE = "prismic-slicemachine-rpc";
|
|
12
|
+
var SliceMachineStatus = /* @__PURE__ */ ((SliceMachineStatus2) => {
|
|
13
|
+
SliceMachineStatus2[SliceMachineStatus2["STARTED"] = 0] = "STARTED";
|
|
14
|
+
SliceMachineStatus2[SliceMachineStatus2["STOPPED"] = 1] = "STOPPED";
|
|
15
|
+
return SliceMachineStatus2;
|
|
16
|
+
})(SliceMachineStatus || {});
|
|
17
|
+
|
|
18
|
+
const DEVTOOLS_UI_ROUTE = "/__prismic-client";
|
|
19
|
+
const DEVTOOLS_UI_LOCAL_PORT = 3300;
|
|
20
|
+
let subProcess = null;
|
|
21
|
+
const stopSubprocess = () => {
|
|
22
|
+
if (subProcess) {
|
|
23
|
+
const pid = subProcess.getProcess().pid;
|
|
24
|
+
if (pid) {
|
|
25
|
+
terminate(pid);
|
|
26
|
+
}
|
|
27
|
+
subProcess.terminate();
|
|
28
|
+
subProcess = null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const setupDevToolsUI = (nuxt, resolver) => {
|
|
32
|
+
const clientPath = resolver.resolve("./client");
|
|
33
|
+
const isProductionBuild = existsSync(clientPath);
|
|
34
|
+
if (isProductionBuild) {
|
|
35
|
+
nuxt.hook("vite:serverCreated", async (server) => {
|
|
36
|
+
const sirv = await import('sirv').then((r) => r.default || r);
|
|
37
|
+
server.middlewares.use(
|
|
38
|
+
DEVTOOLS_UI_ROUTE,
|
|
39
|
+
sirv(clientPath, { dev: true, single: true })
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
nuxt.hook("vite:extendConfig", (config) => {
|
|
44
|
+
config.server = config.server || {};
|
|
45
|
+
config.server.proxy = config.server.proxy || {};
|
|
46
|
+
config.server.proxy[DEVTOOLS_UI_ROUTE] = {
|
|
47
|
+
target: `http://localhost:${DEVTOOLS_UI_LOCAL_PORT}${DEVTOOLS_UI_ROUTE}`,
|
|
48
|
+
changeOrigin: true,
|
|
49
|
+
followRedirects: true,
|
|
50
|
+
rewrite: (path) => path.replace(DEVTOOLS_UI_ROUTE, "")
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
nuxt.hooks.hook("close", () => {
|
|
55
|
+
stopSubprocess();
|
|
56
|
+
});
|
|
57
|
+
process.on("exit", () => {
|
|
58
|
+
stopSubprocess();
|
|
59
|
+
});
|
|
60
|
+
onDevToolsInitialized(() => {
|
|
61
|
+
const rpc = extendServerRpc(
|
|
62
|
+
RPC_NAMESPACE,
|
|
63
|
+
{
|
|
64
|
+
async getSlicemachineConfig() {
|
|
65
|
+
const configPath = resolve(nuxt.options.rootDir, "slicemachine.config.json");
|
|
66
|
+
if (existsSync(configPath)) {
|
|
67
|
+
return await import(configPath);
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
},
|
|
71
|
+
isSliceMachineStarted() {
|
|
72
|
+
return subProcess !== null;
|
|
73
|
+
},
|
|
74
|
+
startSliceMachine() {
|
|
75
|
+
stopSubprocess();
|
|
76
|
+
subProcess = startSubprocess({
|
|
77
|
+
command: "npx",
|
|
78
|
+
args: ["start-slicemachine"],
|
|
79
|
+
cwd: nuxt.options.rootDir
|
|
80
|
+
}, {
|
|
81
|
+
id: "slicemachine",
|
|
82
|
+
name: "SliceMachine",
|
|
83
|
+
icon: "cib:prismic"
|
|
84
|
+
}, nuxt);
|
|
85
|
+
rpc.broadcast.updateStatus(SliceMachineStatus.STARTED);
|
|
86
|
+
return SliceMachineStatus.STARTED;
|
|
87
|
+
},
|
|
88
|
+
stopSliceMachine() {
|
|
89
|
+
stopSubprocess();
|
|
90
|
+
rpc.broadcast.updateStatus(SliceMachineStatus.STOPPED);
|
|
91
|
+
return SliceMachineStatus.STOPPED;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
nuxt.hook("devtools:customTabs", (tabs) => {
|
|
97
|
+
tabs.push({
|
|
98
|
+
// unique identifier
|
|
99
|
+
name: "prismic",
|
|
100
|
+
// title to display in the tab
|
|
101
|
+
title: "Prismic",
|
|
102
|
+
// any icon from Iconify, or a URL to an image
|
|
103
|
+
icon: "logos:prismic-icon",
|
|
104
|
+
// iframe view
|
|
105
|
+
view: {
|
|
106
|
+
type: "iframe",
|
|
107
|
+
src: DEVTOOLS_UI_ROUTE
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
7
112
|
|
|
8
113
|
const logger = consola.withTag("nuxt:prismic");
|
|
9
114
|
|
|
@@ -21,9 +126,9 @@ const module = defineNuxtModule({
|
|
|
21
126
|
meta: {
|
|
22
127
|
name: "@nuxtjs/prismic",
|
|
23
128
|
configKey: "prismic",
|
|
24
|
-
compatibility: { nuxt: "^3.
|
|
129
|
+
compatibility: { nuxt: "^3.7.0" }
|
|
25
130
|
},
|
|
26
|
-
defaults: (
|
|
131
|
+
defaults: (_nuxt) => ({
|
|
27
132
|
endpoint: "",
|
|
28
133
|
environment: "",
|
|
29
134
|
clientConfig: {},
|
|
@@ -33,14 +138,18 @@ const module = defineNuxtModule({
|
|
|
33
138
|
injectComponents: true,
|
|
34
139
|
components: {},
|
|
35
140
|
preview: "/preview",
|
|
36
|
-
toolbar: true
|
|
141
|
+
toolbar: true,
|
|
142
|
+
devtools: true
|
|
37
143
|
}),
|
|
38
144
|
hooks: {},
|
|
39
145
|
setup(options, nuxt) {
|
|
40
|
-
|
|
41
|
-
(_a = nuxt.options.runtimeConfig).public || (_a.public = {});
|
|
146
|
+
nuxt.options.runtimeConfig.public ||= {};
|
|
42
147
|
const moduleOptions = defu(nuxt.options.runtimeConfig.public.prismic, options);
|
|
43
148
|
nuxt.options.runtimeConfig.public.prismic = moduleOptions;
|
|
149
|
+
const resolver = createResolver(import.meta.url);
|
|
150
|
+
if (nuxt.options.devtools && options.devtools) {
|
|
151
|
+
setupDevToolsUI(nuxt, resolver);
|
|
152
|
+
}
|
|
44
153
|
const proxyUserFileWithUndefinedFallback = (filename, path, extensions = ["js", "mjs", "ts"]) => {
|
|
45
154
|
const resolvedFilename = `prismic/proxy/${filename}.ts`;
|
|
46
155
|
const resolvedPath = path.replace(/^(~~|@@)/, nuxt.options.rootDir).replace(/^(~|@)/, nuxt.options.srcDir);
|
|
@@ -67,10 +176,9 @@ const module = defineNuxtModule({
|
|
|
67
176
|
}
|
|
68
177
|
proxyUserFileWithUndefinedFallback("linkResolver", moduleOptions.linkResolver);
|
|
69
178
|
proxyUserFileWithUndefinedFallback("richTextSerializer", moduleOptions.richTextSerializer);
|
|
70
|
-
const resolver = createResolver(import.meta.url);
|
|
71
179
|
nuxt.options.build.transpile.push(resolver.resolve("runtime"), "@nuxtjs/prismic", "@prismicio/vue");
|
|
72
|
-
|
|
73
|
-
|
|
180
|
+
nuxt.options.vite.optimizeDeps ||= {};
|
|
181
|
+
nuxt.options.vite.optimizeDeps.exclude ||= [];
|
|
74
182
|
nuxt.options.vite.optimizeDeps.exclude.push("@prismicio/vue");
|
|
75
183
|
addPlugin(resolver.resolve("runtime/plugin"));
|
|
76
184
|
addPlugin(resolver.resolve("runtime/plugin.client"));
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -25,8 +25,11 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
25
25
|
nuxtApp.vueApp.use(prismicPlugin);
|
|
26
26
|
if (options.preview) {
|
|
27
27
|
const previewCookie = useCookie("io.prismic.preview").value;
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (import.meta.server) {
|
|
29
|
+
const req = useRequestEvent()?.node.req;
|
|
30
|
+
if (req) {
|
|
31
|
+
prismicPlugin.client.enableAutoPreviewsFromReq(req);
|
|
32
|
+
}
|
|
30
33
|
}
|
|
31
34
|
if (previewCookie) {
|
|
32
35
|
try {
|
|
@@ -55,7 +58,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
55
58
|
key: "prismic-preview",
|
|
56
59
|
src: `https://static.cdn.prismic.io/prismic.min.js?repo=${repositoryName}&new=true`,
|
|
57
60
|
async: true,
|
|
58
|
-
defer: true
|
|
61
|
+
defer: true,
|
|
62
|
+
crossorigin: "anonymous"
|
|
59
63
|
}]
|
|
60
64
|
});
|
|
61
65
|
} else {
|
package/dist/types.d.mts
CHANGED
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/prismic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Easily connect your Nuxt 3 application to your content hosted on Prismic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "
|
|
36
|
+
"build": "npm run build:module && npm run build:client",
|
|
37
37
|
"dev": "nuxi dev playground",
|
|
38
38
|
"dev:build": "nuxi build playground",
|
|
39
39
|
"dev:preview": "nuxi preview playground",
|
|
40
40
|
"dev:generate": "nuxi generate playground",
|
|
41
|
+
"build:client": "nuxi generate client",
|
|
42
|
+
"build:module": "nuxt-module-build build",
|
|
41
43
|
"lint": "eslint --ext .js,.ts .",
|
|
42
44
|
"prepare": "nuxi prepare playground && npm run build",
|
|
43
45
|
"release": "npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
|
|
@@ -50,27 +52,41 @@
|
|
|
50
52
|
"unit:watch": "vitest watch"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
53
|
-
"@nuxt/kit": "^
|
|
54
|
-
"@
|
|
55
|
-
"@prismicio/
|
|
55
|
+
"@nuxt/devtools-kit": "^1.1.5",
|
|
56
|
+
"@nuxt/kit": "^3.11.1",
|
|
57
|
+
"@prismicio/client": "^7.4.0",
|
|
58
|
+
"@prismicio/vue": "^4.2.1",
|
|
59
|
+
"birpc": "0.2.17",
|
|
56
60
|
"consola": "^3.2.3",
|
|
57
|
-
"defu": "^6.1.
|
|
61
|
+
"defu": "^6.1.4",
|
|
62
|
+
"pathe": "^1.1.2",
|
|
63
|
+
"sirv": "^2.0.4",
|
|
64
|
+
"terminate": "^2.6.1"
|
|
58
65
|
},
|
|
59
66
|
"devDependencies": {
|
|
60
|
-
"@
|
|
67
|
+
"@iconify-json/carbon": "^1.1.31",
|
|
68
|
+
"@iconify-json/logos": "^1.1.42",
|
|
69
|
+
"@nuxt/devtools-ui-kit": "^1.1.5",
|
|
70
|
+
"@nuxt/module-builder": "^0.5.5",
|
|
71
|
+
"@nuxt/schema": "^3.11.1",
|
|
61
72
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
73
|
+
"@unocss/preset-icons": "^0.58.9",
|
|
74
|
+
"@vitest/coverage-v8": "^1.4.0",
|
|
75
|
+
"eslint": "^8.57.0",
|
|
64
76
|
"mock-fs": "^5.2.0",
|
|
65
|
-
"nuxt": "^3.
|
|
77
|
+
"nuxt": "^3.11.1",
|
|
66
78
|
"standard-version": "^9.5.0",
|
|
67
|
-
"typescript": "^5.
|
|
68
|
-
"vitest": "^
|
|
79
|
+
"typescript": "^5.4.3",
|
|
80
|
+
"vitest": "^1.4.0"
|
|
69
81
|
},
|
|
70
82
|
"engines": {
|
|
71
83
|
"node": ">=16.10.0"
|
|
72
84
|
},
|
|
73
85
|
"publishConfig": {
|
|
74
86
|
"access": "public"
|
|
75
|
-
}
|
|
87
|
+
},
|
|
88
|
+
"workspaces": [
|
|
89
|
+
"./",
|
|
90
|
+
"./client"
|
|
91
|
+
]
|
|
76
92
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
import { extendServerRpc, onDevToolsInitialized, startSubprocess } from '@nuxt/devtools-kit'
|
|
4
|
+
import type { Resolver } from '@nuxt/kit'
|
|
5
|
+
import type { Nuxt } from 'nuxt/schema'
|
|
6
|
+
import { resolve } from 'pathe'
|
|
7
|
+
import terminate from 'terminate'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
RPC_NAMESPACE,
|
|
11
|
+
SliceMachineStatus,
|
|
12
|
+
type ISlicemachineServerFunctions,
|
|
13
|
+
type ISlicemachineClientFunctions
|
|
14
|
+
} from './types'
|
|
15
|
+
|
|
16
|
+
const DEVTOOLS_UI_ROUTE = '/__prismic-client'
|
|
17
|
+
const DEVTOOLS_UI_LOCAL_PORT = 3300
|
|
18
|
+
|
|
19
|
+
let subProcess: null | ReturnType<typeof startSubprocess> = null
|
|
20
|
+
|
|
21
|
+
const stopSubprocess = () => {
|
|
22
|
+
if (subProcess) {
|
|
23
|
+
const pid = subProcess.getProcess().pid
|
|
24
|
+
if (pid) {
|
|
25
|
+
terminate(pid)
|
|
26
|
+
}
|
|
27
|
+
subProcess.terminate()
|
|
28
|
+
subProcess = null
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const setupDevToolsUI = (nuxt: Nuxt, resolver: Resolver) => {
|
|
33
|
+
const clientPath = resolver.resolve('./client')
|
|
34
|
+
const isProductionBuild = existsSync(clientPath)
|
|
35
|
+
|
|
36
|
+
if (isProductionBuild) {
|
|
37
|
+
// Serve production-built client (used when package is published)
|
|
38
|
+
nuxt.hook('vite:serverCreated', async (server) => {
|
|
39
|
+
const sirv = await import('sirv').then(r => r.default || r)
|
|
40
|
+
server.middlewares.use(
|
|
41
|
+
DEVTOOLS_UI_ROUTE,
|
|
42
|
+
sirv(clientPath, { dev: true, single: true })
|
|
43
|
+
)
|
|
44
|
+
})
|
|
45
|
+
} else {
|
|
46
|
+
// In local development, start a separate Nuxt Server and proxy to serve the client
|
|
47
|
+
nuxt.hook('vite:extendConfig', (config) => {
|
|
48
|
+
config.server = config.server || {}
|
|
49
|
+
config.server.proxy = config.server.proxy || {}
|
|
50
|
+
config.server.proxy[DEVTOOLS_UI_ROUTE] = {
|
|
51
|
+
target: `http://localhost:${DEVTOOLS_UI_LOCAL_PORT}${DEVTOOLS_UI_ROUTE}`,
|
|
52
|
+
changeOrigin: true,
|
|
53
|
+
followRedirects: true,
|
|
54
|
+
rewrite: path => path.replace(DEVTOOLS_UI_ROUTE, '')
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
nuxt.hooks.hook('close', () => {
|
|
60
|
+
stopSubprocess()
|
|
61
|
+
})
|
|
62
|
+
process.on('exit', () => {
|
|
63
|
+
stopSubprocess()
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
onDevToolsInitialized(() => {
|
|
67
|
+
const rpc = extendServerRpc<ISlicemachineClientFunctions, ISlicemachineServerFunctions>(
|
|
68
|
+
RPC_NAMESPACE,
|
|
69
|
+
{
|
|
70
|
+
async getSlicemachineConfig () {
|
|
71
|
+
const configPath = resolve(nuxt.options.rootDir, 'slicemachine.config.json')
|
|
72
|
+
|
|
73
|
+
if (existsSync(configPath)) {
|
|
74
|
+
return await import(configPath)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return null
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
isSliceMachineStarted () {
|
|
81
|
+
return subProcess !== null
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
startSliceMachine () {
|
|
85
|
+
stopSubprocess()
|
|
86
|
+
|
|
87
|
+
subProcess = startSubprocess({
|
|
88
|
+
command: 'npx',
|
|
89
|
+
args: ['start-slicemachine'],
|
|
90
|
+
cwd: nuxt.options.rootDir
|
|
91
|
+
}, {
|
|
92
|
+
id: 'slicemachine',
|
|
93
|
+
name: 'SliceMachine',
|
|
94
|
+
icon: 'cib:prismic'
|
|
95
|
+
}, nuxt)
|
|
96
|
+
|
|
97
|
+
rpc.broadcast.updateStatus(SliceMachineStatus.STARTED)
|
|
98
|
+
return SliceMachineStatus.STARTED
|
|
99
|
+
},
|
|
100
|
+
stopSliceMachine () {
|
|
101
|
+
stopSubprocess()
|
|
102
|
+
|
|
103
|
+
rpc.broadcast.updateStatus(SliceMachineStatus.STOPPED)
|
|
104
|
+
return SliceMachineStatus.STOPPED
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
nuxt.hook('devtools:customTabs', (tabs) => {
|
|
110
|
+
tabs.push({
|
|
111
|
+
// unique identifier
|
|
112
|
+
name: 'prismic',
|
|
113
|
+
// title to display in the tab
|
|
114
|
+
title: 'Prismic',
|
|
115
|
+
// any icon from Iconify, or a URL to an image
|
|
116
|
+
icon: 'logos:prismic-icon',
|
|
117
|
+
// iframe view
|
|
118
|
+
view: {
|
|
119
|
+
type: 'iframe',
|
|
120
|
+
src: DEVTOOLS_UI_ROUTE
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BirpcReturn } from 'birpc'
|
|
2
|
+
|
|
3
|
+
export const RPC_NAMESPACE = 'prismic-slicemachine-rpc'
|
|
4
|
+
|
|
5
|
+
export enum SliceMachineStatus {
|
|
6
|
+
STARTED,
|
|
7
|
+
STOPPED
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ISlicemachineClientFunctions {
|
|
11
|
+
updateStatus(status: SliceMachineStatus) : void
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ISlicemachineServerFunctions {
|
|
15
|
+
getSlicemachineConfig() : Promise<Object | null>
|
|
16
|
+
isSliceMachineStarted() : boolean
|
|
17
|
+
startSliceMachine() : SliceMachineStatus
|
|
18
|
+
stopSliceMachine() : SliceMachineStatus
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type RPCServerType = BirpcReturn<ISlicemachineClientFunctions, ISlicemachineServerFunctions>
|
|
22
|
+
export type RPCClientType = BirpcReturn<ISlicemachineServerFunctions, ISlicemachineClientFunctions>
|
package/src/module.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from '@nuxt/kit'
|
|
13
13
|
|
|
14
14
|
import * as prismicVue from '@prismicio/vue'
|
|
15
|
+
import { setupDevToolsUI } from './devtools'
|
|
15
16
|
|
|
16
17
|
import { logger, fileExists } from './lib'
|
|
17
18
|
import type { PrismicModuleOptions } from './types'
|
|
@@ -36,9 +37,9 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
36
37
|
meta: {
|
|
37
38
|
name: '@nuxtjs/prismic',
|
|
38
39
|
configKey: 'prismic',
|
|
39
|
-
compatibility: { nuxt: '^3.
|
|
40
|
+
compatibility: { nuxt: '^3.7.0' }
|
|
40
41
|
},
|
|
41
|
-
defaults:
|
|
42
|
+
defaults: _nuxt => ({
|
|
42
43
|
endpoint: '',
|
|
43
44
|
environment: '',
|
|
44
45
|
clientConfig: {},
|
|
@@ -48,7 +49,8 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
48
49
|
injectComponents: true,
|
|
49
50
|
components: {},
|
|
50
51
|
preview: '/preview',
|
|
51
|
-
toolbar: true
|
|
52
|
+
toolbar: true,
|
|
53
|
+
devtools: true
|
|
52
54
|
}),
|
|
53
55
|
hooks: {},
|
|
54
56
|
setup (options, nuxt) {
|
|
@@ -57,6 +59,12 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
57
59
|
const moduleOptions: PrismicModuleOptions = defu(nuxt.options.runtimeConfig.public.prismic, options)
|
|
58
60
|
nuxt.options.runtimeConfig.public.prismic = moduleOptions
|
|
59
61
|
|
|
62
|
+
// Runtime dir boilerplate
|
|
63
|
+
const resolver = createResolver(import.meta.url)
|
|
64
|
+
if (nuxt.options.devtools && options.devtools) {
|
|
65
|
+
setupDevToolsUI(nuxt, resolver)
|
|
66
|
+
}
|
|
67
|
+
|
|
60
68
|
// Add runtime user code
|
|
61
69
|
const proxyUserFileWithUndefinedFallback =
|
|
62
70
|
(filename: string, path: string, extensions = ['js', 'mjs', 'ts']): boolean => {
|
|
@@ -93,8 +101,6 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
93
101
|
proxyUserFileWithUndefinedFallback('linkResolver', moduleOptions.linkResolver!)
|
|
94
102
|
proxyUserFileWithUndefinedFallback('richTextSerializer', moduleOptions.richTextSerializer!)
|
|
95
103
|
|
|
96
|
-
// Runtime dir boilerplate
|
|
97
|
-
const resolver = createResolver(import.meta.url)
|
|
98
104
|
nuxt.options.build.transpile.push(resolver.resolve('runtime'), '@nuxtjs/prismic', '@prismicio/vue')
|
|
99
105
|
nuxt.options.vite.optimizeDeps ||= {}
|
|
100
106
|
nuxt.options.vite.optimizeDeps.exclude ||= []
|
package/src/runtime/plugin.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isRepositoryEndpoint, getRepositoryName, type Client } from '@prismicio/client'
|
|
2
2
|
import { createPrismic } from '@prismicio/vue'
|
|
3
3
|
|
|
4
|
-
import type { PrismicModuleOptions } from '../types'
|
|
5
4
|
import NuxtLink from '#app/components/nuxt-link'
|
|
5
|
+
import type { PrismicModuleOptions } from '../types'
|
|
6
6
|
import { defineNuxtPlugin, useCookie, useRequestEvent, onNuxtReady, refreshNuxtData, useHead, useRuntimeConfig, useRouter } from '#imports'
|
|
7
7
|
|
|
8
8
|
// @ts-expect-error vfs cannot be resolved here
|
|
@@ -36,8 +36,11 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
36
36
|
const previewCookie = useCookie('io.prismic.preview').value
|
|
37
37
|
|
|
38
38
|
// Update client with req when running server side
|
|
39
|
-
if (
|
|
40
|
-
|
|
39
|
+
if (import.meta.server) {
|
|
40
|
+
const req = useRequestEvent()?.node.req
|
|
41
|
+
if (req) {
|
|
42
|
+
prismicPlugin.client.enableAutoPreviewsFromReq(req)
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
if (previewCookie) {
|
|
@@ -80,7 +83,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
80
83
|
key: 'prismic-preview',
|
|
81
84
|
src: `https://static.cdn.prismic.io/prismic.min.js?repo=${repositoryName}&new=true`,
|
|
82
85
|
async: true,
|
|
83
|
-
defer: true
|
|
86
|
+
defer: true,
|
|
87
|
+
crossorigin: 'anonymous'
|
|
84
88
|
}]
|
|
85
89
|
})
|
|
86
90
|
} else {
|