vue3-sphinx-xml 0.3.2 → 0.4.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/dist/Container.js +2 -2
- package/dist/Container.js.map +1 -1
- package/dist/Raw.js +1 -1
- package/dist/Raw.js.map +1 -1
- package/dist/Warning.js +10 -2
- package/dist/Warning.js.map +1 -1
- package/dist/basereference.js +17 -4
- package/dist/basereference.js.map +1 -1
- package/dist/entry.js +73 -17
- package/dist/entry.js.map +1 -1
- package/dist/methods.js +10 -0
- package/dist/methods.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/Container.js
CHANGED
|
@@ -52,7 +52,7 @@ const _sfc_main = {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
if (classes.value.includes("tab2name")) {
|
|
55
|
-
console.log("tab2name found");
|
|
55
|
+
console.log("***** IN USE tab2name found ??? *****");
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
return (_ctx, _cache) => {
|
|
@@ -74,6 +74,6 @@ const _sfc_main = {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
77
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-45128990"]]);
|
|
78
78
|
export { Container as default };
|
|
79
79
|
//# sourceMappingURL=Container.js.map
|
package/dist/Container.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.js","sources":["../src/components/templates/Container.vue"],"sourcesContent":["<template>\n <div\n :class=\"combinedClasses\"\n @[isToggleHeader&&`click`]=\"toggleHeaderClicked\"\n ref=\"containerElement\"\n >\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 { onMounted, ref, toRefs } from 'vue'\n\nimport { useChildren, useClasses } 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 properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\nconst { classes } = useClasses(node)\nconst { toggleActiveClass } = useMethods()\n\nconst combinedClasses = ref([])\nconst isToggleHeader = ref(false)\nconst containerElement = ref(null)\n\ncombinedClasses.value = [...classes.value]\n\nfunction toggleHeaderClicked() {\n toggleActiveClass(combinedClasses.value)\n const index = combinedClasses.value.indexOf('active')\n let blockType = index === -1 ? 'none' : 'block'\n\n let elementSibling = containerElement.value.nextElementSibling\n while (elementSibling !== null) {\n elementSibling.style.display = blockType\n elementSibling = elementSibling.nextElementSibling\n }\n}\n\nonMounted(() => {\n if (\n classes.value.includes('header') ||\n classes.value.includes('header-left')\n ) {\n combinedClasses.value.push('inactive')\n const parent = node.value.parentElement\n if (parent) {\n if (parent.getAttribute('classes').includes('toggle')) {\n isToggleHeader.value = true\n combinedClasses.value.push('toggle-header')\n }\n }\n }\n\n if (classes.value.includes('tab2name')) {\n console.log('tab2name found')\n }\n})\n</script>\n\n<style scoped>\n.toggle-header {\n cursor: pointer;\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,YAAY,WAAW,IAAI;AACnC,UAAM,EAAE,sBAAsB,WAAY;AAE1C,UAAM,kBAAkB,IAAI,EAAE;AAC9B,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,mBAAmB,IAAI,IAAI;AAEjC,oBAAgB,QAAQ,CAAC,GAAG,QAAQ,KAAK;AAEzC,mCAA+B;AAC7B,wBAAkB,gBAAgB,KAAK;AACvC,YAAM,QAAQ,gBAAgB,MAAM,QAAQ,QAAQ;AACpD,UAAI,YAAY,UAAU,KAAK,SAAS;AAExC,UAAI,iBAAiB,iBAAiB,MAAM;AAC5C,aAAO,mBAAmB,MAAM;AAC9B,uBAAe,MAAM,UAAU;AAC/B,yBAAiB,eAAe;AAAA,MACjC;AAAA,IACH;AAEA,cAAU,MAAM;AACd,UACE,QAAQ,MAAM,SAAS,QAAQ,KAC/B,QAAQ,MAAM,SAAS,aAAa,GACpC;AACA,wBAAgB,MAAM,KAAK,UAAU;AACrC,cAAM,SAAS,KAAK,MAAM;AAC1B,YAAI,QAAQ;AACV,cAAI,OAAO,aAAa,SAAS,EAAE,SAAS,QAAQ,GAAG;AACrD,2BAAe,QAAQ;AACvB,4BAAgB,MAAM,KAAK,eAAe;AAAA,UAC3C;AAAA,QACF;AAAA,MACF;AAED,UAAI,QAAQ,MAAM,SAAS,UAAU,GAAG;AACtC,gBAAQ,IAAI,
|
|
1
|
+
{"version":3,"file":"Container.js","sources":["../src/components/templates/Container.vue"],"sourcesContent":["<template>\n <div\n :class=\"combinedClasses\"\n @[isToggleHeader&&`click`]=\"toggleHeaderClicked\"\n ref=\"containerElement\"\n >\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 { onMounted, ref, toRefs } from 'vue'\n\nimport { useChildren, useClasses } 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 properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\nconst { classes } = useClasses(node)\nconst { toggleActiveClass } = useMethods()\n\nconst combinedClasses = ref([])\nconst isToggleHeader = ref(false)\nconst containerElement = ref(null)\n\ncombinedClasses.value = [...classes.value]\n\nfunction toggleHeaderClicked() {\n toggleActiveClass(combinedClasses.value)\n const index = combinedClasses.value.indexOf('active')\n let blockType = index === -1 ? 'none' : 'block'\n\n let elementSibling = containerElement.value.nextElementSibling\n while (elementSibling !== null) {\n elementSibling.style.display = blockType\n elementSibling = elementSibling.nextElementSibling\n }\n}\n\nonMounted(() => {\n if (\n classes.value.includes('header') ||\n classes.value.includes('header-left')\n ) {\n combinedClasses.value.push('inactive')\n const parent = node.value.parentElement\n if (parent) {\n if (parent.getAttribute('classes').includes('toggle')) {\n isToggleHeader.value = true\n combinedClasses.value.push('toggle-header')\n }\n }\n }\n\n if (classes.value.includes('tab2name')) {\n console.log('***** IN USE tab2name found ??? *****')\n }\n})\n</script>\n\n<style scoped>\n.toggle-header {\n cursor: pointer;\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,YAAY,WAAW,IAAI;AACnC,UAAM,EAAE,sBAAsB,WAAY;AAE1C,UAAM,kBAAkB,IAAI,EAAE;AAC9B,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,mBAAmB,IAAI,IAAI;AAEjC,oBAAgB,QAAQ,CAAC,GAAG,QAAQ,KAAK;AAEzC,mCAA+B;AAC7B,wBAAkB,gBAAgB,KAAK;AACvC,YAAM,QAAQ,gBAAgB,MAAM,QAAQ,QAAQ;AACpD,UAAI,YAAY,UAAU,KAAK,SAAS;AAExC,UAAI,iBAAiB,iBAAiB,MAAM;AAC5C,aAAO,mBAAmB,MAAM;AAC9B,uBAAe,MAAM,UAAU;AAC/B,yBAAiB,eAAe;AAAA,MACjC;AAAA,IACH;AAEA,cAAU,MAAM;AACd,UACE,QAAQ,MAAM,SAAS,QAAQ,KAC/B,QAAQ,MAAM,SAAS,aAAa,GACpC;AACA,wBAAgB,MAAM,KAAK,UAAU;AACrC,cAAM,SAAS,KAAK,MAAM;AAC1B,YAAI,QAAQ;AACV,cAAI,OAAO,aAAa,SAAS,EAAE,SAAS,QAAQ,GAAG;AACrD,2BAAe,QAAQ;AACvB,4BAAgB,MAAM,KAAK,eAAe;AAAA,UAC3C;AAAA,QACF;AAAA,MACF;AAED,UAAI,QAAQ,MAAM,SAAS,UAAU,GAAG;AACtC,gBAAQ,IAAI,uCAAuC;AAAA,MACpD;AAAA,IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Raw.js
CHANGED
package/dist/Raw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Raw.js","sources":["../src/components/templates/Raw.vue"],"sourcesContent":["<template></template>\n\n<script setup>\nconsole.log('****
|
|
1
|
+
{"version":3,"file":"Raw.js","sources":["../src/components/templates/Raw.vue"],"sourcesContent":["<template></template>\n\n<script setup>\nconsole.log('**** Intentionally ignoring this element.')\n</script>\n"],"names":[],"mappings":";;AAGA,YAAQ,IAAI,2CAA2C;;;;;;;"}
|
package/dist/Warning.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toRefs, openBlock, createElementBlock, unref, Fragment, renderList,
|
|
1
|
+
import { toRefs, openBlock, createElementBlock, unref, createBlock, resolveDynamicComponent, withCtx, Fragment, renderList, createTextVNode } from "vue";
|
|
2
2
|
import { u as useMethods } from "./methods.js";
|
|
3
3
|
import { a as useChildren } from "./entry.js";
|
|
4
4
|
import "@hsorby/vue3-katex";
|
|
@@ -7,6 +7,7 @@ import "vue-router";
|
|
|
7
7
|
import "axios";
|
|
8
8
|
import "path-to-regexp";
|
|
9
9
|
const _hoisted_1 = ["id"];
|
|
10
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode("Warning");
|
|
10
11
|
const _sfc_main = {
|
|
11
12
|
props: {
|
|
12
13
|
node: {
|
|
@@ -22,15 +23,22 @@ const _sfc_main = {
|
|
|
22
23
|
},
|
|
23
24
|
setup(__props) {
|
|
24
25
|
const props = __props;
|
|
25
|
-
const { node } = toRefs(props);
|
|
26
|
+
const { node, properties } = toRefs(props);
|
|
26
27
|
const { extractId } = useMethods();
|
|
27
28
|
const { id } = extractId(node.value);
|
|
28
29
|
const { children } = useChildren(node);
|
|
30
|
+
const tagName = "h" + properties.value.depth;
|
|
29
31
|
return (_ctx, _cache) => {
|
|
30
32
|
return openBlock(), createElementBlock("div", {
|
|
31
33
|
id: unref(id),
|
|
32
34
|
class: "admonition warning"
|
|
33
35
|
}, [
|
|
36
|
+
(openBlock(), createBlock(resolveDynamicComponent(tagName), null, {
|
|
37
|
+
default: withCtx(() => [
|
|
38
|
+
_hoisted_2
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
})),
|
|
34
42
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(children), (c, index) => {
|
|
35
43
|
return openBlock(), createBlock(resolveDynamicComponent(c.component), {
|
|
36
44
|
key: "warning_component_" + index,
|
package/dist/Warning.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Warning.js","sources":["../src/components/templates/Warning.vue"],"sourcesContent":["<template>\n <div :id=\"id\" class=\"admonition warning\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'warning_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 { 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 }
|
|
1
|
+
{"version":3,"file":"Warning.js","sources":["../src/components/templates/Warning.vue"],"sourcesContent":["<template>\n <div :id=\"id\" class=\"admonition warning\">\n <component :is=\"tagName\">Warning</component>\n <component\n v-for=\"(c, index) in children\"\n :key=\"'warning_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 { 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, properties } = toRefs(props)\n\nconst { extractId } = useMethods()\nconst { id } = extractId(node.value)\n\nconst { children } = useChildren(node)\nconst tagName = 'h' + properties.value.depth\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,UAAM,EAAE,MAAM,eAAe,OAAO,KAAK;AAEzC,UAAM,EAAE,cAAc,WAAY;AAClC,UAAM,EAAE,OAAO,UAAU,KAAK,KAAK;AAEnC,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,UAAU,MAAM,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/basereference.js
CHANGED
|
@@ -4,14 +4,15 @@ const {
|
|
|
4
4
|
determinePageLocation,
|
|
5
5
|
determinePageName,
|
|
6
6
|
isInternalReference,
|
|
7
|
-
isReferenceToCurrentPage
|
|
7
|
+
isReferenceToCurrentPage,
|
|
8
|
+
parentLevelsInRefURI
|
|
8
9
|
} = useMethods();
|
|
9
10
|
const useBaseReference = (element, route, routeDescription) => {
|
|
10
11
|
const sphinxStore = useSphinxStore();
|
|
11
12
|
const onReferenceCreated = () => {
|
|
12
13
|
if (isInternalReference(element)) {
|
|
13
14
|
let pageName = constructPageNameFromRoute(route);
|
|
14
|
-
|
|
15
|
+
let baseRefUri = determineRouteUrl(route);
|
|
15
16
|
const pageReference = element.getAttribute("refid");
|
|
16
17
|
if (pageReference && !pageReference.startsWith("#")) {
|
|
17
18
|
routeDescription.value.hash = "#" + pageReference;
|
|
@@ -20,8 +21,20 @@ const useBaseReference = (element, route, routeDescription) => {
|
|
|
20
21
|
}
|
|
21
22
|
if (!isReferenceToCurrentPage(element)) {
|
|
22
23
|
pageName = determinePageName(element, route);
|
|
24
|
+
let parentLevels = parentLevelsInRefURI(element);
|
|
25
|
+
if (sphinxStore.isOffsetReferenceURL(baseRefUri) && parentLevels) {
|
|
26
|
+
let parts = baseRefUri.split("/");
|
|
27
|
+
while (parentLevels--) {
|
|
28
|
+
parts.pop();
|
|
29
|
+
}
|
|
30
|
+
if (parts.length === 1) {
|
|
31
|
+
baseRefUri = "/";
|
|
32
|
+
} else {
|
|
33
|
+
baseRefUri = parts.join("/");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
23
36
|
routeDescription.value.hash = determinePageLocation(element);
|
|
24
|
-
const existingPageWrapper = sphinxStore.
|
|
37
|
+
const existingPageWrapper = sphinxStore.hasPageById(baseRefUri, pageName);
|
|
25
38
|
if (!existingPageWrapper) {
|
|
26
39
|
sphinxStore.fetchPage({
|
|
27
40
|
page_name: pageName,
|
|
@@ -30,7 +43,7 @@ const useBaseReference = (element, route, routeDescription) => {
|
|
|
30
43
|
});
|
|
31
44
|
}
|
|
32
45
|
}
|
|
33
|
-
routeDescription.value.path = baseRefUri + "/" + pageName;
|
|
46
|
+
routeDescription.value.path = baseRefUri === "/" ? baseRefUri + pageName : baseRefUri + "/" + pageName;
|
|
34
47
|
}
|
|
35
48
|
};
|
|
36
49
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basereference.js","sources":["../src/composables/basereference.js"],"sourcesContent":["import { useSphinxStore } from '@/stores/sphinx'\n\nimport { useMethods } from './methods'\nimport { determineRouteUrl, constructPageNameFromRoute } from '../js/utilities'\n\nconst {\n determinePageLocation,\n determinePageName,\n isInternalReference,\n isReferenceToCurrentPage,\n} = useMethods()\n\nexport const useBaseReference = (element, route, routeDescription) => {\n const sphinxStore = useSphinxStore()\n\n const onReferenceCreated = () => {\n if (isInternalReference(element)) {\n let pageName = constructPageNameFromRoute(route)\n
|
|
1
|
+
{"version":3,"file":"basereference.js","sources":["../src/composables/basereference.js"],"sourcesContent":["import { useSphinxStore } from '@/stores/sphinx'\n\nimport { useMethods } from './methods'\nimport { determineRouteUrl, constructPageNameFromRoute } from '../js/utilities'\n\nconst {\n determinePageLocation,\n determinePageName,\n isInternalReference,\n isReferenceToCurrentPage,\n parentLevelsInRefURI,\n} = useMethods()\n\nexport const useBaseReference = (element, route, routeDescription) => {\n const sphinxStore = useSphinxStore()\n\n const onReferenceCreated = () => {\n if (isInternalReference(element)) {\n let pageName = constructPageNameFromRoute(route)\n let baseRefUri = determineRouteUrl(route)\n const pageReference = element.getAttribute('refid')\n if (pageReference && !pageReference.startsWith('#')) {\n routeDescription.value.hash = '#' + pageReference\n } else {\n routeDescription.value.hash = pageReference\n }\n if (!isReferenceToCurrentPage(element)) {\n pageName = determinePageName(element, route)\n let parentLevels = parentLevelsInRefURI(element)\n if (sphinxStore.isOffsetReferenceURL(baseRefUri) && parentLevels) {\n let parts = baseRefUri.split('/')\n while(parentLevels--) {\n parts.pop()\n }\n if (parts.length === 1) {\n baseRefUri = '/'\n } else {\n baseRefUri = parts.join('/')\n }\n }\n routeDescription.value.hash = determinePageLocation(element)\n const existingPageWrapper = sphinxStore.hasPageById(\n baseRefUri,\n pageName,\n )\n if (!existingPageWrapper) {\n sphinxStore.fetchPage({\n page_name: pageName,\n page_route: baseRefUri,\n page_url: sphinxStore.getBaseUrl(baseRefUri),\n })\n }\n }\n\n routeDescription.value.path = baseRefUri === '/' ? baseRefUri + pageName : baseRefUri + '/' + pageName\n }\n }\n return {\n onReferenceCreated,\n }\n}\n"],"names":[],"mappings":";;AAKA,MAAM;AAAA,EACJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,IACE,WAAY;AAEJ,MAAC,mBAAmB,CAAC,SAAS,OAAO,qBAAqB;AACpE,QAAM,cAAc,eAAgB;AAEpC,QAAM,qBAAqB,MAAM;AAC/B,QAAI,oBAAoB,OAAO,GAAG;AAChC,UAAI,WAAW,2BAA2B,KAAK;AAC/C,UAAI,aAAa,kBAAkB,KAAK;AACxC,YAAM,gBAAgB,QAAQ,aAAa,OAAO;AAClD,UAAI,iBAAiB,CAAC,cAAc,WAAW,GAAG,GAAG;AACnD,yBAAiB,MAAM,OAAO,MAAM;AAAA,MAC5C,OAAa;AACL,yBAAiB,MAAM,OAAO;AAAA,MAC/B;AACD,UAAI,CAAC,yBAAyB,OAAO,GAAG;AACtC,mBAAW,kBAAkB,SAAS,KAAK;AAC3C,YAAI,eAAe,qBAAqB,OAAO;AAC/C,YAAI,YAAY,qBAAqB,UAAU,KAAK,cAAc;AAChE,cAAI,QAAQ,WAAW,MAAM,GAAG;AAChC,iBAAM,gBAAgB;AACpB,kBAAM,IAAK;AAAA,UACZ;AACD,cAAI,MAAM,WAAW,GAAG;AACtB,yBAAa;AAAA,UACzB,OAAiB;AACL,yBAAa,MAAM,KAAK,GAAG;AAAA,UAC5B;AAAA,QACF;AACD,yBAAiB,MAAM,OAAO,sBAAsB,OAAO;AAC3D,cAAM,sBAAsB,YAAY,YACtC,YACA,QACD;AACD,YAAI,CAAC,qBAAqB;AACxB,sBAAY,UAAU;AAAA,YACpB,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,UAAU,YAAY,WAAW,UAAU;AAAA,UACvD,CAAW;AAAA,QACF;AAAA,MACF;AAED,uBAAiB,MAAM,OAAO,eAAe,MAAM,aAAa,WAAW,aAAa,MAAM;AAAA,IAC/F;AAAA,EACF;AACD,SAAO;AAAA,IACL;AAAA,EACD;AACH;;"}
|
package/dist/entry.js
CHANGED
|
@@ -44942,12 +44942,19 @@ const useSphinxStore = defineStore("sphinx", {
|
|
|
44942
44942
|
urlMap: /* @__PURE__ */ new Map(),
|
|
44943
44943
|
inflight: /* @__PURE__ */ new Map(),
|
|
44944
44944
|
downloadURLs: /* @__PURE__ */ new Map(),
|
|
44945
|
-
imagesURLs: /* @__PURE__ */ new Map()
|
|
44945
|
+
imagesURLs: /* @__PURE__ */ new Map(),
|
|
44946
|
+
offsetReferenceURLs: /* @__PURE__ */ new Map()
|
|
44946
44947
|
}),
|
|
44947
44948
|
getters: {
|
|
44949
|
+
printPages: (state) => () => {
|
|
44950
|
+
console.log(state.pages);
|
|
44951
|
+
},
|
|
44948
44952
|
getPageById: (state) => (routeURL, id2) => {
|
|
44949
44953
|
return state.pages.get(routeURL).find((page) => page.id === id2);
|
|
44950
44954
|
},
|
|
44955
|
+
hasPageById: (state) => (routeURL, id2) => {
|
|
44956
|
+
return !!state.getPageById(routeURL, id2);
|
|
44957
|
+
},
|
|
44951
44958
|
getInflight: (state) => (routeURL, id2) => {
|
|
44952
44959
|
return state.inflight.get(routeURL).get(id2);
|
|
44953
44960
|
},
|
|
@@ -44962,6 +44969,9 @@ const useSphinxStore = defineStore("sphinx", {
|
|
|
44962
44969
|
},
|
|
44963
44970
|
getImagesURL: (state) => (routeURL) => {
|
|
44964
44971
|
return state.imagesURLs.get(routeURL);
|
|
44972
|
+
},
|
|
44973
|
+
isOffsetReferenceURL: (state) => (routeURL) => {
|
|
44974
|
+
return state.offsetReferenceURLs.get(routeURL);
|
|
44965
44975
|
}
|
|
44966
44976
|
},
|
|
44967
44977
|
actions: {
|
|
@@ -44984,13 +44994,21 @@ const useSphinxStore = defineStore("sphinx", {
|
|
|
44984
44994
|
removeInflight({ routeURL, id: id2 }) {
|
|
44985
44995
|
this.inflight.get(routeURL).delete(id2);
|
|
44986
44996
|
},
|
|
44987
|
-
registerRouteUrl({
|
|
44997
|
+
registerRouteUrl({
|
|
44998
|
+
baseURL,
|
|
44999
|
+
routeURL,
|
|
45000
|
+
downloadsURL,
|
|
45001
|
+
imagesURL,
|
|
45002
|
+
offsetRouteURL
|
|
45003
|
+
}) {
|
|
44988
45004
|
const registeredURL = this.pages.get(routeURL);
|
|
45005
|
+
const activeRouteURL = offsetRouteURL ? offsetRouteURL : routeURL;
|
|
45006
|
+
this.downloadURLs.set(activeRouteURL, downloadsURL);
|
|
45007
|
+
this.imagesURLs.set(activeRouteURL, imagesURL);
|
|
45008
|
+
this.offsetReferenceURLs.set(activeRouteURL, offsetRouteURL ? true : false);
|
|
44989
45009
|
if (!registeredURL) {
|
|
44990
45010
|
this.pages.set(routeURL, []);
|
|
44991
45011
|
this.urlMap.set(routeURL, baseURL);
|
|
44992
|
-
this.downloadURLs.set(routeURL, downloadsURL);
|
|
44993
|
-
this.imagesURLs.set(routeURL, imagesURL);
|
|
44994
45012
|
this.inflight.set(routeURL, /* @__PURE__ */ new Map());
|
|
44995
45013
|
}
|
|
44996
45014
|
},
|
|
@@ -44998,12 +45016,6 @@ const useSphinxStore = defineStore("sphinx", {
|
|
|
44998
45016
|
const page_name = payload.page_name;
|
|
44999
45017
|
const page_route = payload.page_route;
|
|
45000
45018
|
const base_url = payload.page_url;
|
|
45001
|
-
this.registerRouteUrl({
|
|
45002
|
-
baseURL: base_url,
|
|
45003
|
-
routeURL: page_route,
|
|
45004
|
-
downloadsURL: payload.page_downloads,
|
|
45005
|
-
imagesURL: payload.page_images
|
|
45006
|
-
});
|
|
45007
45019
|
const existingPage = this.getPageById(page_route, page_name);
|
|
45008
45020
|
if (existingPage) {
|
|
45009
45021
|
return Promise.resolve(existingPage);
|
|
@@ -45015,6 +45027,7 @@ const useSphinxStore = defineStore("sphinx", {
|
|
|
45015
45027
|
let parser = new DOMParser();
|
|
45016
45028
|
let xmlDoc = parser.parseFromString(response.data, "text/xml");
|
|
45017
45029
|
const documentElement = xmlDoc.querySelector("document");
|
|
45030
|
+
documentElement.id = page_name;
|
|
45018
45031
|
this.appendPage({ routeURL: page_route, page: documentElement });
|
|
45019
45032
|
this.removeInflight({ routeURL: page_route, id: page_name });
|
|
45020
45033
|
return documentElement;
|
|
@@ -45126,6 +45139,7 @@ var LoadingComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "
|
|
|
45126
45139
|
const nodeNameTagNameMap = /* @__PURE__ */ new Map([
|
|
45127
45140
|
["bullet_list", "ul"],
|
|
45128
45141
|
["button", "button"],
|
|
45142
|
+
["citation", "cite"],
|
|
45129
45143
|
["definition", "dd"],
|
|
45130
45144
|
["definition_list", "dl"],
|
|
45131
45145
|
["definition_list_item", "dt"],
|
|
@@ -45336,6 +45350,18 @@ function defineChildComponent(name, node) {
|
|
|
45336
45350
|
properties = {
|
|
45337
45351
|
text: node.nodeValue
|
|
45338
45352
|
};
|
|
45353
|
+
} else if (node.nodeName === "warning") {
|
|
45354
|
+
let parentNode = node.parentNode;
|
|
45355
|
+
let depth = 0;
|
|
45356
|
+
while (parentNode) {
|
|
45357
|
+
if (parentNode.nodeName === "section") {
|
|
45358
|
+
depth += 1;
|
|
45359
|
+
}
|
|
45360
|
+
parentNode = parentNode.parentNode;
|
|
45361
|
+
}
|
|
45362
|
+
properties = {
|
|
45363
|
+
depth
|
|
45364
|
+
};
|
|
45339
45365
|
} else if (node.nodeName === "title") {
|
|
45340
45366
|
let parentNode = node.parentNode;
|
|
45341
45367
|
let depth = 0;
|
|
@@ -45406,7 +45432,7 @@ function addTGroup(components, node, columns) {
|
|
|
45406
45432
|
colspecs.push(colspec.getAttribute("colwidth"));
|
|
45407
45433
|
}
|
|
45408
45434
|
if (colspecs.length !== columns) {
|
|
45409
|
-
console.log("Something is not right.");
|
|
45435
|
+
console.log("***** Something is not right. *****", colspecs.length, columns);
|
|
45410
45436
|
}
|
|
45411
45437
|
components.push(defineColgroupComponent(node, colspecs));
|
|
45412
45438
|
return components;
|
|
@@ -45505,6 +45531,10 @@ const _sfc_main = {
|
|
|
45505
45531
|
type: String,
|
|
45506
45532
|
default: "/"
|
|
45507
45533
|
},
|
|
45534
|
+
referenceBaseURL: {
|
|
45535
|
+
type: String,
|
|
45536
|
+
default: void 0
|
|
45537
|
+
},
|
|
45508
45538
|
downloadBaseURL: {
|
|
45509
45539
|
type: String,
|
|
45510
45540
|
default: ""
|
|
@@ -45530,6 +45560,7 @@ const _sfc_main = {
|
|
|
45530
45560
|
const props = __props;
|
|
45531
45561
|
const {
|
|
45532
45562
|
baseURL,
|
|
45563
|
+
referenceBaseURL,
|
|
45533
45564
|
downloadBaseURL,
|
|
45534
45565
|
imagesBaseURL,
|
|
45535
45566
|
indexFileName,
|
|
@@ -45601,15 +45632,40 @@ const _sfc_main = {
|
|
|
45601
45632
|
}
|
|
45602
45633
|
const resolvedImagesBaseURL = imagesBaseURL.value === "" ? `${baseURL.value}/_images` : imagesBaseURL.value;
|
|
45603
45634
|
const resolvedDownloadBaseURL = downloadBaseURL.value === "" ? `${baseURL.value}/_downloads` : downloadBaseURL.value;
|
|
45635
|
+
let tmpBaseURL = baseURL.value;
|
|
45636
|
+
let tmpRouteURL = routeURL;
|
|
45637
|
+
let tmpPageName = pageName;
|
|
45638
|
+
if (referenceBaseURL.value) {
|
|
45639
|
+
let baseURLParts = tmpBaseURL.split(referenceBaseURL.value);
|
|
45640
|
+
const value = baseURLParts.pop();
|
|
45641
|
+
if (value === indexFileName.value) {
|
|
45642
|
+
baseURLParts.pop();
|
|
45643
|
+
}
|
|
45644
|
+
if (referenceBaseURL.value !== "/") {
|
|
45645
|
+
baseURLParts.push(referenceBaseURL.value);
|
|
45646
|
+
}
|
|
45647
|
+
tmpBaseURL = baseURLParts.join("/").replace("//", "/");
|
|
45648
|
+
let routeURLParts = tmpRouteURL.split(referenceBaseURL.value);
|
|
45649
|
+
const routeEnd = routeURLParts.pop();
|
|
45650
|
+
routeURLParts.push(referenceBaseURL.value);
|
|
45651
|
+
tmpRouteURL = routeURLParts.join("/").replace("//", "/");
|
|
45652
|
+
const pagePrefix = routeEnd[0] === "/" ? routeEnd.slice(1) : routeEnd;
|
|
45653
|
+
tmpPageName = pagePrefix + "/" + tmpPageName;
|
|
45654
|
+
}
|
|
45655
|
+
sphinxStore.registerRouteUrl({
|
|
45656
|
+
baseURL: tmpBaseURL,
|
|
45657
|
+
routeURL: tmpRouteURL,
|
|
45658
|
+
downloadsURL: resolvedDownloadBaseURL,
|
|
45659
|
+
imagesURL: resolvedImagesBaseURL,
|
|
45660
|
+
offsetRouteURL: referenceBaseURL.value === void 0 ? false : routeURL
|
|
45661
|
+
});
|
|
45604
45662
|
sphinxStore.fetchPage({
|
|
45605
|
-
page_name:
|
|
45606
|
-
page_route:
|
|
45607
|
-
page_url:
|
|
45608
|
-
page_downloads: resolvedDownloadBaseURL,
|
|
45609
|
-
page_images: resolvedImagesBaseURL
|
|
45663
|
+
page_name: tmpPageName,
|
|
45664
|
+
page_route: tmpRouteURL,
|
|
45665
|
+
page_url: tmpBaseURL
|
|
45610
45666
|
}).then((response) => {
|
|
45611
45667
|
element.value = response;
|
|
45612
|
-
id2.value = "page_" +
|
|
45668
|
+
id2.value = "page_" + tmpPageName.replace("/", "_");
|
|
45613
45669
|
}).catch(() => {
|
|
45614
45670
|
router.push({
|
|
45615
45671
|
name: pageNotFoundName.value,
|