vue3-sphinx-xml 0.1.0 → 0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Footnote.js","sources":["../src/components/templates/Footnote.vue"],"sourcesContent":["<template>\n <div :=\"attrs\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'footnote_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nimport { toRefs, ref } from 'vue'\n\nimport { useMethods } from '../../composables/methods'\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\nconst { children } = useChildren(node)\nconst { dataObject } = useMethods()\nconst attrs = ref({})\n\nattrs.value = dataObject(node.value, ['footnote']).attrs // import { h } from 'vue'\n\n// import { sphinxChildren } from '../../mixins/SphinxChildren'\n\n// export default {\n// name: 'Footnote',\n// mixins: [sphinxChildren],\n// render() {\n// return h(\n// 'div', // tag name\n// this.dataObject(['footnote']),\n// this.children.map(child => h(child)), // array of children\n// )\n// },\n// }\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,QAAQ,IAAI,EAAE;AAEpB,UAAM,QAAQ,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,EAAE;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Footnote.js","sources":["../src/components/templates/Footnote.vue"],"sourcesContent":["<template>\n <div :=\"attrs\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'footnote_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nimport { toRefs, ref } from 'vue'\n\nimport { useMethods } from '../../composables/methods'\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\nconst { children } = useChildren(node)\nconst { dataObject } = useMethods()\nconst attrs = ref({})\n\nattrs.value = dataObject(node.value, ['footnote']).attrs // import { h } from 'vue'\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,QAAQ,IAAI,EAAE;AAEpB,UAAM,QAAQ,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,EAAE;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FootnoteReference.js","sources":["../src/components/templates/FootnoteReference.vue"],"sourcesContent":["<template>\n <router-link v-if=\"isInternalReference(node)\" :to=\"routeDescription\">\n [{{ node.textContent }}]\n </router-link>\n <a v-else :href=\"node.getAttribute('refuri')\" target=\"_blank\">\n [{{ node.textContent }}]\n </a>\n</template>\n\n<script setup>\nimport { onMounted, toRefs, ref } from 'vue'\nimport { useRoute } from 'vue-router'\n\nimport { useMethods } from '../../composables/methods'\nimport { useBaseReference } from '../../composables/basereference'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n})\n\nconst routeDescription = ref({path: '', hash: ''})\nconst { node } = toRefs(props)\nconst route = useRoute()\n\nconst { isInternalReference } = useMethods()\nconst { onReferenceCreated } = useBaseReference(node.value, route, routeDescription)\n\nonMounted(onReferenceCreated)\n\n// import { baseReference } from '../../mixins/BaseReference'\n\n// export default {\n// name: 'FootnoteReference',\n// mixins: [baseReference],\n// }\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,mBAAmB,IAAI,EAAC,MAAM,IAAI,MAAM,GAAE,CAAC;AACjD,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,QAAQ,SAAU;AAExB,UAAM,EAAE,wBAAwB,WAAY;AAC5C,UAAM,EAAE,uBAAuB,iBAAiB,KAAK,OAAO,OAAO,gBAAgB;AAEnF,cAAU,kBAAkB;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"FootnoteReference.js","sources":["../src/components/templates/FootnoteReference.vue"],"sourcesContent":["<template>\n <router-link v-if=\"isInternalReference(node)\" :to=\"routeDescription\">\n [{{ node.textContent }}]\n </router-link>\n <a v-else :href=\"node.getAttribute('refuri')\" target=\"_blank\">\n [{{ node.textContent }}]\n </a>\n</template>\n\n<script setup>\nimport { onMounted, toRefs, ref } from 'vue'\nimport { useRoute } from 'vue-router'\n\nimport { useMethods } from '../../composables/methods'\nimport { useBaseReference } from '../../composables/basereference'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n})\n\nconst routeDescription = ref({path: '', hash: ''})\nconst { node } = toRefs(props)\nconst route = useRoute()\n\nconst { isInternalReference } = useMethods()\nconst { onReferenceCreated } = useBaseReference(node.value, route, routeDescription)\n\nonMounted(onReferenceCreated)\n\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,mBAAmB,IAAI,EAAC,MAAM,IAAI,MAAM,GAAE,CAAC;AACjD,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,QAAQ,SAAU;AAExB,UAAM,EAAE,wBAAwB,WAAY;AAC5C,UAAM,EAAE,uBAAuB,iBAAiB,KAAK,OAAO,OAAO,gBAAgB;AAEnF,cAAU,kBAAkB;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.js","sources":["../src/components/templates/Legend.vue"],"sourcesContent":["<template>\n <div :class=\"classes\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'container_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nconsole.log(\"***** IN USE *****\")\nimport { toRefs } from 'vue'\n\nimport { useChildren, useClasses } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\nconst { classes } = useClasses(node)\n// import { baseDiv } from '../../mixins/BaseDiv'\n// import { sphinxChildren } from '../../mixins/SphinxChildren'\n\n// export default {\n// name: 'Legend',\n// mixins: [baseDiv, sphinxChildren],\n// computed: {\n// classes() {\n// return ['legend']\n// },\n// },\n// }\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcA,YAAQ,IAAI,oBAAoB;AAkBhC,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,YAAY,WAAW,IAAI;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Legend.js","sources":["../src/components/templates/Legend.vue"],"sourcesContent":["<template>\n <div :class=\"classes\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'container_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nimport { toRefs } from 'vue'\n\nimport { useChildren, useClasses } from '../../composables/computed'\n\nconsole.log('***** IN USE *****')\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\nconst { classes } = useClasses(node)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBA,YAAQ,IAAI,oBAAoB;AAchC,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,YAAY,WAAW,IAAI;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LineSingle.js","sources":["../src/components/templates/LineSingle.vue"],"sourcesContent":["<template>\n <div :=\"attrs\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'footnote_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nconsole.log('***** IN USE *****')\nimport { toRefs, ref } from 'vue'\n\nimport { useMethods } from '../../composables/methods'\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\nconst { children } = useChildren(node)\nconst { dataObject } = useMethods()\nconst attrs = ref({})\n\nattrs.value = dataObject(node.value, ['line_single']).attrs // import { h } from 'vue'\n// import { h } from 'vue'\n\n// import { sphinxChildren } from '../../mixins/SphinxChildren'\n\n// export default {\n// name: 'LineSingle',\n// mixins: [sphinxChildren],\n// render() {\n// return h(\n// 'div', // tag name\n// this.dataObject(['line_single']),\n// this.children.map(child => h(child)), // array of children\n// )\n// },\n// }\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcA,YAAQ,IAAI,oBAAoB;AAmBhC,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,QAAQ,IAAI,EAAE;AAEpB,UAAM,QAAQ,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,EAAE;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LineSingle.js","sources":["../src/components/templates/LineSingle.vue"],"sourcesContent":["<template>\n <div :=\"attrs\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'footnote_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nimport { toRefs, ref } from 'vue'\n\nimport { useMethods } from '../../composables/methods'\nimport { useChildren } from '../../composables/computed'\n\nconsole.log('***** IN USE *****')\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\nconst { children } = useChildren(node)\nconst { dataObject } = useMethods()\nconst attrs = ref({})\n\nattrs.value = dataObject(node.value, ['line_single']).attrs\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBA,YAAQ,IAAI,oBAAoB;AAehC,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,QAAQ,IAAI,EAAE;AAEpB,UAAM,QAAQ,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,EAAE;;;;;;;;;;;;;;;;"}
package/dist/Literal.js CHANGED
@@ -29,12 +29,16 @@ const _sfc_main = {
29
29
  const v = dataObject(node.value);
30
30
  const isEmpty = (d) => {
31
31
  for (const i in d) {
32
+ if (d[i].language === "") {
33
+ continue;
34
+ }
32
35
  return false;
33
36
  }
34
37
  return true;
35
38
  };
36
39
  if (!isEmpty(v)) {
37
40
  console.log("Something needs to be done with this:", v);
41
+ console.log(node.value.innerHTML);
38
42
  }
39
43
  return (_ctx, _cache) => {
40
44
  return openBlock(), createElementBlock("code", null, [
@@ -1 +1 @@
1
- {"version":3,"file":"Literal.js","sources":["../src/components/templates/Literal.vue"],"sourcesContent":["<template>\n <code>\n <span class=\"pre\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'code_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </span>\n </code>\n</template>\n\n<script setup>\nimport { toRefs } from 'vue'\n\nimport { useMethods } from '../../composables/methods'\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { dataObject } = useMethods()\n\nconst { children } = useChildren(node)\n\nconst v = dataObject(node.value)\nconst isEmpty = (d) => {\n for (const i in d) {\n return false\n }\n\n return true\n}\n\nif (!isEmpty(v)) {\n console.log('Something needs to be done with this:', v)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,eAAe,WAAY;AAEnC,UAAM,EAAE,aAAa,YAAY,IAAI;AAErC,UAAM,IAAI,WAAW,KAAK,KAAK;AAC/B,UAAM,UAAU,CAAC,MAAM;AACrB,iBAAW,KAAK,GAAG;AACjB,eAAO;AAAA,MACR;AAED,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,QAAQ,CAAC,GAAG;AACf,cAAQ,IAAI,yCAAyC,CAAC;AAAA,IACxD;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Literal.js","sources":["../src/components/templates/Literal.vue"],"sourcesContent":["<template>\n <code>\n <span class=\"pre\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'code_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </span>\n </code>\n</template>\n\n<script setup>\nimport { toRefs } from 'vue'\n\nimport { useMethods } from '../../composables/methods'\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { dataObject } = useMethods()\n\nconst { children } = useChildren(node)\n\nconst v = dataObject(node.value)\nconst isEmpty = (d) => {\n for (const i in d) {\n if (d[i].language === '') {\n continue\n }\n return false\n }\n\n return true\n}\n\nif (!isEmpty(v)) {\n console.log('Something needs to be done with this:', v)\n console.log(node.value.innerHTML)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,eAAe,WAAY;AAEnC,UAAM,EAAE,aAAa,YAAY,IAAI;AAErC,UAAM,IAAI,WAAW,KAAK,KAAK;AAC/B,UAAM,UAAU,CAAC,MAAM;AACrB,iBAAW,KAAK,GAAG;AACjB,YAAI,EAAE,GAAG,aAAa,IAAI;AACxB;AAAA,QACD;AACD,eAAO;AAAA,MACR;AAED,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,QAAQ,CAAC,GAAG;AACf,cAAQ,IAAI,yCAAyC,CAAC;AACtD,cAAQ,IAAI,KAAK,MAAM,SAAS;AAAA,IAClC;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LiteralBlock.js","sources":["../src/components/templates/LiteralBlock.vue"],"sourcesContent":["<template>\n <pre v-highlightjs><code :class=\"sourceLanguage\">{{ sourceCode }}</code></pre>\n</template>\n\n<script setup>\nimport { computed, toRefs } from 'vue'\n\nimport { decodeHTML } from '../../js/utilities'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst sourceLanguage = computed(() => {\n let language = node.value.getAttribute('language')\n if (language === 'console' || language === 'default') {\n language = 'bash'\n } else if (language === 'text') {\n language = 'plaintext'\n }\n return language\n})\n\nconst sourceCode = computed(() => {\n return decodeHTML(node.value.innerHTML)\n})\n// export default {\n// name: 'LiteralBlock',\n// props: {\n// element: {\n// type: undefined,\n// },\n// },\n// computed: {\n// sourceLanguage() {\n// let language = this.element.getAttribute('language')\n// if (language === 'console' || language === 'default') {\n// language = 'bash'\n// } else if (language === 'text') {\n// language = 'plaintext'\n// }\n// return language\n// },\n// sourceCode() {\n// return decodeHTML(this.element.innerHTML)\n// },\n// },\n// }\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,iBAAiB,SAAS,MAAM;AACpC,UAAI,WAAW,KAAK,MAAM,aAAa,UAAU;AACjD,UAAI,aAAa,aAAa,aAAa,WAAW;AACpD,mBAAW;AAAA,MACf,WAAa,aAAa,QAAQ;AAC9B,mBAAW;AAAA,MACZ;AACD,aAAO;AAAA,IACT,CAAC;AAED,UAAM,aAAa,SAAS,MAAM;AAChC,aAAO,WAAW,KAAK,MAAM,SAAS;AAAA,IACxC,CAAC;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LiteralBlock.js","sources":["../src/components/templates/LiteralBlock.vue"],"sourcesContent":["<template>\n <pre v-highlightjs><code :class=\"sourceLanguage\">{{ sourceCode }}</code></pre>\n</template>\n\n<script setup>\nimport { computed, toRefs } from 'vue'\n\nimport { decodeHTML } from '../../js/utilities'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst sourceLanguage = computed(() => {\n let language = node.value.getAttribute('language')\n if (language === 'console' || language === 'default') {\n language = 'bash'\n } else if (language === 'text') {\n language = 'plaintext'\n }\n return language\n})\n\nconst sourceCode = computed(() => {\n return decodeHTML(node.value.innerHTML)\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,iBAAiB,SAAS,MAAM;AACpC,UAAI,WAAW,KAAK,MAAM,aAAa,UAAU;AACjD,UAAI,aAAa,aAAa,aAAa,WAAW;AACpD,mBAAW;AAAA,MACf,WAAa,aAAa,QAAQ;AAC9B,mBAAW;AAAA,MACZ;AACD,aAAO;AAAA,IACT,CAAC;AAED,UAAM,aAAa,SAAS,MAAM;AAChC,aAAO,WAAW,KAAK,MAAM,SAAS;AAAA,IACxC,CAAC;;;;;;;;;;;;;;"}
@@ -50,6 +50,9 @@ const _sfc_main = {
50
50
  attrs.value = __spreadProps(__spreadValues({}, tmpDataObject.attrs), {
51
51
  class: classList
52
52
  });
53
+ if (attrs.value.prefix === "") {
54
+ delete attrs.value.prefix;
55
+ }
53
56
  if (node.value.nodeName === "button") {
54
57
  isButton.value = true;
55
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StandardElement.js","sources":["../src/components/templates/StandardElement.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :=\"attrs\"\n @[isButton&&`click`]=\"buttonClicked\"\n ref=\"componentElement\"\n >\n <component\n v-for=\"(c, index) in children\"\n :key=\"'standard_element_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </component>\n</template>\n\n<script setup>\nimport { defineProps, toRefs, ref } from 'vue'\n\nimport { nodeNameTagNameMap } from '../../js/nodemap'\nimport { useChildren } from '../../composables/computed'\nimport { useMethods } from '../../composables/methods'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n})\n\nconst { node } = toRefs(props)\nconst { children } = useChildren(node)\nconst { dataObject } = useMethods()\nconst attrs = ref({})\nconst isButton = ref(false)\nconst componentElement = ref(null)\n\nconst transferAttributes = new Set(['div', 'button'])\nconst tag = nodeNameTagNameMap.get(node.value.nodeName)\n\n// if (transferAttributes.has(node.value.nodeName)) {\nconst tmpDataObject = dataObject(node.value, node.value.getAttribute('classes'))\nconst classList = tmpDataObject.class ? tmpDataObject.class.join(' ') : undefined\nattrs.value = {\n ...tmpDataObject.attrs,\n class: classList,\n}\n// }\nif (node.value.nodeName === 'button') {\n isButton.value = true\n}\n\nfunction buttonClicked() {\n if (componentElement.value.getAttribute('aria-selected') === 'false') {\n const parentElement = componentElement.value.parentElement\n let panels = []\n for (const child of parentElement.children) {\n const el = document.getElementById(child.id)\n el.setAttribute(\n 'aria-selected',\n el.getAttribute('aria-selected') === 'true' ? 'false' : 'true',\n )\n panels.push({ id: child.getAttribute('aria-controls') })\n }\n for (const panel of panels) {\n const el = document.getElementById(panel.id)\n if (el.hasAttribute('hidden')) {\n el.removeAttribute('hidden')\n } else {\n el.setAttribute('hidden', '')\n }\n }\n }\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,WAAW,IAAI,KAAK;AAC1B,UAAM,mBAAmB,IAAI,IAAI;AAGjC,UAAM,MAAM,mBAAmB,IAAI,KAAK,MAAM,QAAQ;AAGtD,UAAM,gBAAgB,WAAW,KAAK,OAAO,KAAK,MAAM,aAAa,SAAS,CAAC;AAC/E,UAAM,YAAY,cAAc,QAAQ,cAAc,MAAM,KAAK,GAAG,IAAI;AACxE,UAAM,QAAQ,iCACT,cAAc,QADL;AAAA,MAEZ,OAAO;AAAA,IACT;AAEA,QAAI,KAAK,MAAM,aAAa,UAAU;AACpC,eAAS,QAAQ;AAAA,IACnB;AAEA,6BAAyB;AACvB,UAAI,iBAAiB,MAAM,aAAa,eAAe,MAAM,SAAS;AACpE,cAAM,gBAAgB,iBAAiB,MAAM;AAC7C,YAAI,SAAS,CAAE;AACf,mBAAW,SAAS,cAAc,UAAU;AAC1C,gBAAM,KAAK,SAAS,eAAe,MAAM,EAAE;AAC3C,aAAG,aACD,iBACA,GAAG,aAAa,eAAe,MAAM,SAAS,UAAU,MACzD;AACD,iBAAO,KAAK,EAAE,IAAI,MAAM,aAAa,eAAe,GAAG;AAAA,QACxD;AACD,mBAAW,SAAS,QAAQ;AAC1B,gBAAM,KAAK,SAAS,eAAe,MAAM,EAAE;AAC3C,cAAI,GAAG,aAAa,QAAQ,GAAG;AAC7B,eAAG,gBAAgB,QAAQ;AAAA,UACnC,OAAa;AACL,eAAG,aAAa,UAAU,EAAE;AAAA,UAC7B;AAAA,QACF;AAAA,MACF;AAAA,IACH;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"StandardElement.js","sources":["../src/components/templates/StandardElement.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :=\"attrs\"\n @[isButton&&`click`]=\"buttonClicked\"\n ref=\"componentElement\"\n >\n <component\n v-for=\"(c, index) in children\"\n :key=\"'standard_element_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </component>\n</template>\n\n<script setup>\nimport { defineProps, toRefs, ref } from 'vue'\n\nimport { nodeNameTagNameMap } from '../../js/nodemap'\nimport { useChildren } from '../../composables/computed'\nimport { useMethods } from '../../composables/methods'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n})\n\nconst { node } = toRefs(props)\nconst { children } = useChildren(node)\nconst { dataObject } = useMethods()\nconst attrs = ref({})\nconst isButton = ref(false)\nconst componentElement = ref(null)\n\nconst transferAttributes = new Set(['div', 'button'])\nconst tag = nodeNameTagNameMap.get(node.value.nodeName)\n\nconst tmpDataObject = dataObject(node.value, node.value.getAttribute('classes'))\nconst classList = tmpDataObject.class\n ? tmpDataObject.class.join(' ')\n : undefined\nattrs.value = {\n ...tmpDataObject.attrs,\n class: classList,\n}\n\n// An empty prefix attribute causes problems for <ol> elements.\nif (attrs.value.prefix === '') {\n delete attrs.value.prefix\n}\n\nif (node.value.nodeName === 'button') {\n isButton.value = true\n}\n\nfunction buttonClicked() {\n if (componentElement.value.getAttribute('aria-selected') === 'false') {\n const parentElement = componentElement.value.parentElement\n let panels = []\n for (const child of parentElement.children) {\n const el = document.getElementById(child.id)\n el.setAttribute(\n 'aria-selected',\n el.getAttribute('aria-selected') === 'true' ? 'false' : 'true',\n )\n panels.push({ id: child.getAttribute('aria-controls') })\n }\n for (const panel of panels) {\n const el = document.getElementById(panel.id)\n if (el.hasAttribute('hidden')) {\n el.removeAttribute('hidden')\n } else {\n el.setAttribute('hidden', '')\n }\n }\n }\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,WAAW,IAAI,KAAK;AAC1B,UAAM,mBAAmB,IAAI,IAAI;AAGjC,UAAM,MAAM,mBAAmB,IAAI,KAAK,MAAM,QAAQ;AAEtD,UAAM,gBAAgB,WAAW,KAAK,OAAO,KAAK,MAAM,aAAa,SAAS,CAAC;AAC/E,UAAM,YAAY,cAAc,QAC5B,cAAc,MAAM,KAAK,GAAG,IAC5B;AACJ,UAAM,QAAQ,iCACT,cAAc,QADL;AAAA,MAEZ,OAAO;AAAA,IACT;AAGA,QAAI,MAAM,MAAM,WAAW,IAAI;AAC7B,aAAO,MAAM,MAAM;AAAA,IACrB;AAEA,QAAI,KAAK,MAAM,aAAa,UAAU;AACpC,eAAS,QAAQ;AAAA,IACnB;AAEA,6BAAyB;AACvB,UAAI,iBAAiB,MAAM,aAAa,eAAe,MAAM,SAAS;AACpE,cAAM,gBAAgB,iBAAiB,MAAM;AAC7C,YAAI,SAAS,CAAE;AACf,mBAAW,SAAS,cAAc,UAAU;AAC1C,gBAAM,KAAK,SAAS,eAAe,MAAM,EAAE;AAC3C,aAAG,aACD,iBACA,GAAG,aAAa,eAAe,MAAM,SAAS,UAAU,MACzD;AACD,iBAAO,KAAK,EAAE,IAAI,MAAM,aAAa,eAAe,GAAG;AAAA,QACxD;AACD,mBAAW,SAAS,QAAQ;AAC1B,gBAAM,KAAK,SAAS,eAAe,MAAM,EAAE;AAC3C,cAAI,GAAG,aAAa,QAAQ,GAAG;AAC7B,eAAG,gBAAgB,QAAQ;AAAA,UACnC,OAAa;AACL,eAAG,aAAa,UAAU,EAAE;AAAA,UAC7B;AAAA,QACF;AAAA,MACF;AAAA,IACH;;;;;;;;;;;;;;;;;;;;;;;"}