@xleddyl/nuxt-cms 0.11.0 → 0.11.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xleddyl/nuxt-cms",
3
3
  "configKey": "cms",
4
- "version": "0.11.0",
4
+ "version": "0.11.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -0,0 +1,4 @@
1
+ declare module '*.css?inline' {
2
+ const css: string
3
+ export default css
4
+ }
@@ -86,7 +86,7 @@ import {
86
86
  watch
87
87
  } from "#imports";
88
88
  import { Icon as KIcon } from "@xleddyl/443-components-vue";
89
- import tokensHref from "@xleddyl/443-components-vue/tokens.css?url";
89
+ import tokensCss from "@xleddyl/443-components-vue/tokens.css?inline";
90
90
  import cmsConfig from "#cms-config";
91
91
  import { cmsPreviewComponents } from "#cms-blocks";
92
92
  import {
@@ -117,7 +117,7 @@ const inline = shallowRef(null);
117
117
  useHead({
118
118
  title: "Preview",
119
119
  meta: [{ name: "robots", content: "noindex, nofollow" }],
120
- link: [{ rel: "stylesheet", href: tokensHref }],
120
+ style: [{ key: "cms-tokens", innerHTML: tokensCss }],
121
121
  htmlAttrs: { lang: computed(() => state.value?.locale) }
122
122
  });
123
123
  const entry = computed(
@@ -31,19 +31,18 @@
31
31
  </template>
32
32
 
33
33
  <script setup>
34
- import tokensHref from "@xleddyl/443-components-vue/tokens.css?url";
34
+ import tokensCss from "@xleddyl/443-components-vue/tokens.css?inline";
35
35
  import { computed, onMounted, ref, watch } from "vue";
36
36
  const props = defineProps({
37
37
  mode: { type: Object, required: true }
38
38
  });
39
39
  const dismissed = ref(false);
40
40
  onMounted(() => {
41
- if (document.querySelector("link[data-cms-tokens]")) return;
42
- const link = document.createElement("link");
43
- link.rel = "stylesheet";
44
- link.href = tokensHref;
45
- link.dataset.cmsTokens = "";
46
- document.head.appendChild(link);
41
+ if (document.querySelector("style[data-cms-tokens]")) return;
42
+ const style = document.createElement("style");
43
+ style.textContent = tokensCss;
44
+ style.dataset.cmsTokens = "";
45
+ document.head.appendChild(style);
47
46
  });
48
47
  watch(
49
48
  () => props.mode.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/nuxt-cms",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Lightweight CMS that ships with your Nuxt app: runs on the Nitro server, content types defined in code, /cms admin panel, GraphQL API, SQLite or Postgres. No external CMS needed!",
5
5
  "license": "MIT",
6
6
  "author": "Edoardo Alberti (https://github.com/xleddyl)",
@@ -1,4 +0,0 @@
1
- declare module '*.css?url' {
2
- const href: string
3
- export default href
4
- }