elseware-docs-engine 1.0.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 ADDED
@@ -0,0 +1 @@
1
+ # elseware Docs Engine
package/dist/index.css ADDED
@@ -0,0 +1,2 @@
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;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;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.min-h-screen{min-height:100vh}.w-full{width:100%}.max-w-lg{max-width:32rem}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-3{gap:.75rem}.gap-4{gap:1rem}.rounded-2xl{border-radius:1rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-neutral-950{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-10{padding:2.5rem}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.pt-\[54px\]{padding-top:54px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-6xl{font-size:3.75rem;line-height:1}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-relaxed{line-height:1.625}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:opacity-90:hover{opacity:.9}
2
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/styles/index.css"],"sourcesContent":["*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\r\n.fixed {\n position: fixed;\n}\r\n.mb-3 {\n margin-bottom: 0.75rem;\n}\r\n.mb-4 {\n margin-bottom: 1rem;\n}\r\n.mb-8 {\n margin-bottom: 2rem;\n}\r\n.flex {\n display: flex;\n}\r\n.inline-flex {\n display: inline-flex;\n}\r\n.h-10 {\n height: 2.5rem;\n}\r\n.min-h-screen {\n min-height: 100vh;\n}\r\n.w-full {\n width: 100%;\n}\r\n.max-w-lg {\n max-width: 32rem;\n}\r\n.flex-row {\n flex-direction: row;\n}\r\n.flex-col {\n flex-direction: column;\n}\r\n.items-center {\n align-items: center;\n}\r\n.justify-center {\n justify-content: center;\n}\r\n.justify-between {\n justify-content: space-between;\n}\r\n.gap-3 {\n gap: 0.75rem;\n}\r\n.gap-4 {\n gap: 1rem;\n}\r\n.rounded-2xl {\n border-radius: 1rem;\n}\r\n.rounded-lg {\n border-radius: 0.5rem;\n}\r\n.border {\n border-width: 1px;\n}\r\n.border-gray-800 {\n --tw-border-opacity: 1;\n border-color: rgb(31 41 55 / var(--tw-border-opacity, 1));\n}\r\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\r\n.bg-neutral-950 {\n --tw-bg-opacity: 1;\n background-color: rgb(10 10 10 / var(--tw-bg-opacity, 1));\n}\r\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\r\n.p-10 {\n padding: 2.5rem;\n}\r\n.p-4 {\n padding: 1rem;\n}\r\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\r\n.px-5 {\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n}\r\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\r\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\r\n.py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n}\r\n.pt-\\[54px\\] {\n padding-top: 54px;\n}\r\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\r\n.text-6xl {\n font-size: 3.75rem;\n line-height: 1;\n}\r\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\r\n.font-bold {\n font-weight: 700;\n}\r\n.font-medium {\n font-weight: 500;\n}\r\n.font-semibold {\n font-weight: 600;\n}\r\n.leading-relaxed {\n line-height: 1.625;\n}\r\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity, 1));\n}\r\n.text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\r\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\r\n.shadow-2xl {\n --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\r\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\r\n.hover\\:cursor-pointer:hover {\n cursor: pointer;\n}\r\n.hover\\:opacity-90:hover {\n opacity: 0.9;\n}"],"mappings":"AAAA,EAAG,QAAU,OACX,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,aACA,aACA,kBACA,6BAA6B,UAC7B,8BACA,6BACA,4BACA,eACA,oBACA,sBACA,uBACA,wBACA,kBACA,wBAAwB,IACxB,wBAAwB,KACxB,iBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE,IAClC,yBAAyB,EAAE,EAAE,MAC7B,kBAAkB,EAAE,EAAE,MACtB,aAAa,EAAE,EAAE,MACjB,qBAAqB,EAAE,EAAE,MACzB,YACA,kBACA,gBACA,iBACA,kBACA,cACA,gBACA,aACA,mBACA,qBACA,2BACA,yBACA,0BACA,2BACA,uBACA,wBACA,yBACA,sBACA,oBACA,sBACA,qBACA,oBACF,CAEA,WACE,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,aACA,aACA,kBACA,6BAA6B,UAC7B,8BACA,6BACA,4BACA,eACA,oBACA,sBACA,uBACA,wBACA,kBACA,wBAAwB,IACxB,wBAAwB,KACxB,iBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE,IAClC,yBAAyB,EAAE,EAAE,MAC7B,kBAAkB,EAAE,EAAE,MACtB,aAAa,EAAE,EAAE,MACjB,qBAAqB,EAAE,EAAE,MACzB,YACA,kBACA,gBACA,iBACA,kBACA,cACA,gBACA,aACA,mBACA,qBACA,2BACA,yBACA,0BACA,2BACA,uBACA,wBACA,yBACA,sBACA,oBACA,sBACA,qBACA,oBACF,CAOA,EACA,QACA,OACE,WAAY,WACZ,aAAc,EACd,aAAc,MACd,aAAc,OAChB,CAEA,QACA,OACE,cAAc,EAChB,CAYA,KACA,MACE,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AAoB,UACpB,eAAgB,IAClB,CAMA,4BACE,mBAAoB,IACtB,CAOA,6BACE,mBAAoB,OACpB,KAAM,OACR,CAMA,QACE,QAAS,SACX,CAMA,WACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,OACA,EACA,IAjZA,OAkZU,CACV,CAEA,SArZA,OAsZU,EAtZV,QAuZW,CACX,CAEA,OA1ZA,QA2ZW,CACX,CAEA,GACA,GACA,KACE,WAAY,KAjad,OAkaU,EAlaV,QAmaW,CACX,CAKA,OAzaA,QA0aW,CACX,CAMA,SACE,OAAQ,QACV,CAOA,KAAK,mBAAoB,QAAQ,mBAC/B,QAAS,EACT,MAAO,OACT,CAEA,KAAK,cACL,QAAQ,cACN,QAAS,EACT,MAAO,OACT,CAMA,OACA,CAAC,aACC,OAAQ,OACV,CAKA,UACE,OAAQ,OACV,CAQA,IACA,IACA,MACA,OACA,MACA,OACA,MACA,OACE,QAAS,MACT,eAAgB,MAClB,CAMA,IACA,MACE,UAAW,KACX,OAAQ,IACV,CAGA,CAAC,OAAO,OAAO,KAAK,CAAC,sBACnB,QAAS,IACX,CACA,CAAC,MACC,SAAU,KACZ,CACA,CAAC,KACC,cAAe,MACjB,CACA,CAAC,KACC,cAAe,IACjB,CACA,CAAC,KACC,cAAe,IACjB,CACA,CAAC,KACC,QAAS,IACX,CACA,CAAC,YACC,QAAS,WACX,CACA,CAAC,KACC,OAAQ,MACV,CACA,CAAC,aACC,WAAY,KACd,CACA,CAAC,OACC,MAAO,IACT,CACA,CAAC,SACC,UAAW,KACb,CACA,CAAC,SACC,eAAgB,GAClB,CACA,CAAC,SACC,eAAgB,MAClB,CACA,CAAC,aACC,YAAa,MACf,CACA,CAAC,eACC,gBAAiB,MACnB,CACA,CAAC,gBACC,gBAAiB,aACnB,CACA,CAAC,MACC,IAAK,MACP,CACA,CAAC,MACC,IAAK,IACP,CACA,CAAC,YAxiBD,cAyiBiB,IACjB,CACA,CAAC,WA3iBD,cA4iBiB,KACjB,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AI,EAAE,EAAE,EAAE,EAAE,KAC3C,qBAAqB,EAAE,KAAK,KAAK,MAAM,IAAI,mBAC3C,WAAY,IAAI,uBAAuB,EAAE,EAAE,EAAE,MAAM,CAAE,IAAI,gBAAgB,EAAE,EAAE,EAAE,MAAM,CAAE,IAAI,YAC7F,CACA,CAAC,eACC,oBAAqB,IACrB,2BAA4B,aAAa,EAAG,CAAE,CAAC,CAAE,EAAG,CAAE,GACtD,oBAAqB,IACvB,CACA,CAAC,qBAAqB,OACpB,OAAQ,OACV,CACA,CAAC,iBAAiB,OAChB,QAAS,EACX","names":[]}
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface DocsPage {
4
+ title: string;
5
+ path: string;
6
+ content: string;
7
+ }
8
+ interface DocsCategory {
9
+ title: string;
10
+ path: string;
11
+ children: DocsNode[];
12
+ }
13
+ type DocsNode = DocsCategory | DocsPage;
14
+
15
+ interface DocsEngineProps {
16
+ docs: DocsCategory[];
17
+ basePath?: string;
18
+ }
19
+ declare function DocsEngine({ docs, basePath }: DocsEngineProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { type DocsCategory, DocsEngine, type DocsNode, type DocsPage };
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface DocsPage {
4
+ title: string;
5
+ path: string;
6
+ content: string;
7
+ }
8
+ interface DocsCategory {
9
+ title: string;
10
+ path: string;
11
+ children: DocsNode[];
12
+ }
13
+ type DocsNode = DocsCategory | DocsPage;
14
+
15
+ interface DocsEngineProps {
16
+ docs: DocsCategory[];
17
+ basePath?: string;
18
+ }
19
+ declare function DocsEngine({ docs, basePath }: DocsEngineProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { type DocsCategory, DocsEngine, type DocsNode, type DocsPage };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ 'use strict';require('elseware-ui/styles.css');var reactRouterDom=require('react-router-dom'),react=require('react'),jsxRuntime=require('react/jsx-runtime'),elsewareUi=require('elseware-ui'),G=require('classnames');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var G__default=/*#__PURE__*/_interopDefault(G);var f=react.createContext(void 0);function B({docs:e,basePath:t,children:o}){return jsxRuntime.jsx(f.Provider,{value:{docs:e,basePath:t},children:o})}var v=B;function h(e,t,o=""){for(let r of e){let i=`${o}${r.path}`.replace(/\/+/g,"/");if(m(r)){if(i.replace(/^\//,"")===t.replace(/^\//,""))return {...r,path:i};continue}let n=h(r.children,t,i);if(n)return n}return null}function m(e){return "content"in e}function d(e,t=""){for(let o of e){let r=`${t}${o.path}`.replace(/\/+/g,"/");if(m(o))return r;let i=d(o.children,r);if(i)return i}return null}function D(e,t,o=""){return e.map(r=>{let i=`${o}${r.path}`.replace(/\/+/g,"/");return m(r)?{type:"item",name:r.title,to:`/${t}${i}`.replace(/\/+/g,"/")}:{type:"group",name:r.title,items:D(r.children,t,i)}})}function k(e,t){return D(e,t)}function P(){let e=react.useContext(f);if(!e)throw new Error("useDocs must be used within DocsProvider");return e}function V(){let e=reactRouterDom.useNavigate();return jsxRuntime.jsx(elsewareUi.Brand,{alt:"elseware Docs Engine",onClick:()=>e("/"),className:G__default.default({"inline-flex h-10 hover:cursor-pointer w-full items-center justify-center":true})})}var C=V;function Z({enableSidebar:e=false,onToggleSidebar:t}){let o=elsewareUi.useIsMobile(),{show:r,openDrawer:i,closeDrawer:n}=elsewareUi.useDrawer(false);return react.useEffect(()=>{o||n();},[o]),jsxRuntime.jsxs(elsewareUi.Header,{position:"fixed",styles:"px-3 py-1",children:[jsxRuntime.jsxs("div",{className:"flex flex-row items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-3",children:[e&&jsxRuntime.jsx(elsewareUi.DrawerToggler,{toggleDrawer:t}),jsxRuntime.jsx(C,{})]}),!o&&jsxRuntime.jsxs("div",{className:"flex flex-row gap-3 items-center",children:[jsxRuntime.jsx(elsewareUi.ThemeSwitch,{}),jsxRuntime.jsx(elsewareUi.ShapeSwitch,{})]}),o&&jsxRuntime.jsx(elsewareUi.DrawerToggler,{toggleDrawer:i})]}),jsxRuntime.jsx(elsewareUi.Drawer,{side:"right",visibility:r,handleClose:n,children:jsxRuntime.jsx("div",{className:"flex flex-col gap-4 p-4",children:jsxRuntime.jsx("div",{className:"flex flex-row items-center justify-between",children:jsxRuntime.jsxs("div",{className:"flex flex-row gap-3 items-center",children:[jsxRuntime.jsx(elsewareUi.ThemeSwitch,{}),jsxRuntime.jsx(elsewareUi.ShapeSwitch,{})]})})})})]})}var S=Z;function oe({children:e}){return jsxRuntime.jsx(elsewareUi.EUIProvider,{config:{global:{shape:"roundedSquare"}},children:jsxRuntime.jsx(elsewareUi.ThemeProvider,{defaultTheme:"dark",children:jsxRuntime.jsx("div",{children:e})})})}var E=oe;function ie({homeUrl:e}){return jsxRuntime.jsx("div",{className:"flex min-h-screen items-center justify-center bg-black px-6",children:jsxRuntime.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-gray-800 bg-neutral-950 p-10 shadow-2xl",children:[jsxRuntime.jsx("div",{className:"mb-4 text-6xl font-bold text-white",children:"404"}),jsxRuntime.jsx("h1",{className:"mb-3 text-2xl font-semibold text-white",children:"Page not found"}),jsxRuntime.jsx("p",{className:"mb-8 text-sm leading-relaxed text-gray-400",children:"The page you are looking for does not exist or may have been moved."}),jsxRuntime.jsx(reactRouterDom.Link,{to:e,className:"inline-flex items-center rounded-lg bg-white px-5 py-2.5 text-sm font-medium text-black transition-all hover:opacity-90",children:"Go to Home"})]})})}var g=ie;function we(){let{docs:e,basePath:t}=P(),o=reactRouterDom.useNavigate(),r=reactRouterDom.useLocation(),i=reactRouterDom.useParams(),n=elsewareUi.useIsMobile(),{show:p,openDrawer:y,closeDrawer:x}=elsewareUi.useDrawer(!n);react.useEffect(()=>{n?p&&x():!p&&y();},[n]);let $=i["*"]??"",u=h(e,$);if(!u){let A=d(e)??"/",I=`${t}${A}`.replace(/\/+/g,"/");return jsxRuntime.jsx(g,{homeUrl:I})}let T=k(e,t);return jsxRuntime.jsx(E,{children:jsxRuntime.jsxs(elsewareUi.Layout,{children:[jsxRuntime.jsx(S,{enableSidebar:true,onToggleSidebar:y}),jsxRuntime.jsxs(elsewareUi.Content,{sidebarVisible:!n&&p,styles:"pt-[54px]",children:[jsxRuntime.jsx(elsewareUi.Drawer,{side:"left",visibility:p,handleClose:x,children:jsxRuntime.jsx(elsewareUi.Sidebar,{items:T,navigate:o,currentPath:r.pathname})}),jsxRuntime.jsx(elsewareUi.ContentArea,{children:jsxRuntime.jsx(elsewareUi.DocumentationLayout,{value:u.content},u.path)})]})]})})}var M=we;function L({docs:e,basePath:t}){let o=d(e)??"/",r=`${t}${o}`.replace(/\/+/g,"/");return [{path:`/${t}/*`,element:jsxRuntime.jsx(M,{})},{path:"*",element:jsxRuntime.jsx(g,{homeUrl:r})}]}function ve({docs:e,basePath:t}){return reactRouterDom.useRoutes(L({docs:e,basePath:t}))}function De({docs:e,basePath:t="/docs"}){let o=t.startsWith("/")?t:`/${t}`;return jsxRuntime.jsx(v,{docs:e,basePath:o,children:jsxRuntime.jsx(reactRouterDom.BrowserRouter,{children:jsxRuntime.jsx(ve,{docs:e,basePath:o})})})}var ke=De;
2
+ exports.DocsEngine=ke;//# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/context/DocsContext.ts","../src/context/DocsProvider.tsx","../src/utils/page.ts","../src/loaders/generateSidebar.ts","../src/hooks/useDocs.ts","../src/components/brand/Brand.tsx","../src/components/header/Header.tsx","../src/layouts/GenericLayout.tsx","../src/components/not-found/NotFound.tsx","../src/layouts/DocsLayout.tsx","../src/router/generateRoutes.tsx","../src/engine/DocsEngine.tsx"],"names":["DocsContext","createContext","DocsProvider","docs","basePath","children","jsx","DocsProvider_default","findPageByPath","nodes","targetPath","parentPath","node","fullPath","isPage","found","findFirstPage","nested","mapNodes","generateSidebar","useDocs","context","useContext","Brand","navigate","useNavigate","EUIBrand","classNames","Brand_default","Header","enableSidebar","onToggleSidebar","isMobile","useIsMobile","showMobile","openDrawerMobile","closeDrawerMobile","useDrawer","useEffect","jsxs","EUIHeader","DrawerToggler","ThemeSwitch","ShapeSwitch","Drawer","Header_default","GenericLayout","EUIProvider","ThemeProvider","GenericLayout_default","NotFound","homeUrl","Link","NotFound_default","DocsLayout","location","useLocation","params","useParams","show","openDrawer","closeDrawer","pagePath","page","firstPage","sidebar","Layout","Content","Sidebar","ContentArea","DocumentationLayout","DocsLayout_default","generateRoutes","DocsRoutes","useRoutes","DocsEngine","normalizedBasePath","BrowserRouter","DocsEngine_default"],"mappings":"uUAQO,IAAMA,EAAcC,mBAAAA,CACzB,MACF,CAAA,CCEA,SAASC,CAAAA,CAAa,CAAE,IAAA,CAAAC,CAAAA,CAAM,QAAA,CAAAC,CAAAA,CAAU,SAAAC,CAAS,CAAA,CAAsB,CACrE,OACEC,cAAAA,CAACN,CAAAA,CAAY,SAAZ,CAAqB,KAAA,CAAO,CAAE,IAAA,CAAAG,CAAAA,CAAM,QAAA,CAAAC,CAAS,CAAA,CAC3C,QAAA,CAAAC,CAAAA,CACH,CAEJ,CAEA,IAAOE,EAAQL,CAAAA,CClBR,SAASM,CAAAA,CACdC,CAAAA,CACAC,EACAC,CAAAA,CAAa,EAAA,CACI,CACjB,IAAA,IAAWC,CAAAA,IAAQH,CAAAA,CAAO,CACxB,IAAMI,CAAAA,CAAW,CAAA,EAAGF,CAAU,CAAA,EAAGC,CAAAA,CAAK,IAAI,CAAA,CAAA,CAAG,OAAA,CAAQ,MAAA,CAAQ,GAAG,CAAA,CAEhE,GAAIE,EAAOF,CAAI,CAAA,CAAG,CAChB,GAAIC,CAAAA,CAAS,OAAA,CAAQ,MAAO,EAAE,CAAA,GAAMH,CAAAA,CAAW,OAAA,CAAQ,KAAA,CAAO,EAAE,EAC9D,OAAO,CACL,GAAGE,CAAAA,CAEH,IAAA,CAAMC,CACR,EA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E,CAAAA,CAAoB,CAAA,CACxD,CAAA,CACF,CAEJ,CAEA,IAAOE,EAAAA,CAAQH","file":"index.js","sourcesContent":["import { createContext } from \"react\";\r\nimport { DocsCategory } from \"../types/docs\";\r\n\r\nexport interface DocsContextType {\r\n docs: DocsCategory[];\r\n basePath: string;\r\n}\r\n\r\nexport const DocsContext = createContext<DocsContextType | undefined>(\r\n undefined,\r\n);\r\n","import React from \"react\";\r\n\r\nimport { DocsContext } from \"./DocsContext\";\r\n\r\nimport { DocsCategory } from \"../types/docs\";\r\n\r\ninterface DocsProviderProps {\r\n docs: DocsCategory[];\r\n basePath: string;\r\n children: React.ReactNode;\r\n}\r\n\r\nfunction DocsProvider({ docs, basePath, children }: DocsProviderProps) {\r\n return (\r\n <DocsContext.Provider value={{ docs, basePath }}>\r\n {children}\r\n </DocsContext.Provider>\r\n );\r\n}\r\n\r\nexport default DocsProvider;\r\n","import { DocsNode, DocsPage } from \"../types/docs\";\r\n\r\nexport function findPageByPath(\r\n nodes: DocsNode[],\r\n targetPath: string,\r\n parentPath = \"\",\r\n): DocsPage | null {\r\n for (const node of nodes) {\r\n const fullPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n if (fullPath.replace(/^\\//, \"\") === targetPath.replace(/^\\//, \"\")) {\r\n return {\r\n ...node,\r\n\r\n path: fullPath,\r\n };\r\n }\r\n\r\n continue;\r\n }\r\n\r\n const found = findPageByPath(node.children, targetPath, fullPath);\r\n\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport interface ResolvedDocsPage extends DocsPage {\r\n id: string;\r\n fullPath: string;\r\n}\r\n\r\nexport function isPage(node: DocsNode): node is DocsPage {\r\n return \"content\" in node;\r\n}\r\n\r\nexport function resolveDocs(\r\n nodes: DocsNode[],\r\n parentPath = \"\",\r\n): ResolvedDocsPage[] {\r\n const pages: ResolvedDocsPage[] = [];\r\n\r\n nodes.forEach((node) => {\r\n const currentPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n pages.push({\r\n ...node,\r\n\r\n id: currentPath.replace(/\\//g, \"-\").replace(/^-/, \"\"),\r\n\r\n fullPath: currentPath,\r\n });\r\n\r\n return;\r\n }\r\n\r\n pages.push(...resolveDocs(node.children, currentPath));\r\n });\r\n\r\n return pages;\r\n}\r\n\r\nexport function findFirstPage(\r\n nodes: DocsNode[],\r\n parentPath = \"\",\r\n): string | null {\r\n for (const node of nodes) {\r\n const fullPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n return fullPath;\r\n }\r\n\r\n const nested = findFirstPage(node.children, fullPath);\r\n\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n","import { MenuNode } from \"elseware-ui\";\r\n\r\nimport { DocsCategory, DocsNode, DocsPage } from \"../types/docs\";\r\n\r\nimport { isPage } from \"../utils/page\";\r\n\r\nfunction mapNodes(\r\n nodes: DocsNode[],\r\n basePath: string,\r\n parentPath = \"\",\r\n): MenuNode[] {\r\n return nodes.map((node) => {\r\n const fullPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n return {\r\n type: \"item\",\r\n\r\n name: node.title,\r\n\r\n to: `/${basePath}${fullPath}`.replace(/\\/+/g, \"/\"),\r\n };\r\n }\r\n\r\n return {\r\n type: \"group\",\r\n\r\n name: node.title,\r\n\r\n items: mapNodes(node.children, basePath, fullPath),\r\n };\r\n });\r\n}\r\n\r\nexport function generateSidebar(\r\n docs: DocsCategory[],\r\n\r\n basePath: string,\r\n): MenuNode[] {\r\n return mapNodes(docs, basePath);\r\n}\r\n","import { useContext } from \"react\";\r\n\r\nimport { DocsContext } from \"../context/DocsContext\";\r\n\r\nexport function useDocs() {\r\n const context = useContext(DocsContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDocs must be used within DocsProvider\");\r\n }\r\n\r\n return context;\r\n}\r\n","// Hooks / Node modules / Styles\r\nimport classNames from \"classnames\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { Brand as EUIBrand } from \"elseware-ui\";\r\n\r\n// Reducers / Actions\r\n\r\n// Utils / Functions\r\n\r\n// Components\r\n\r\n// Sub-Components\r\n\r\n// Data / Images / Icons\r\n\r\nfunction Brand() {\r\n const navigate = useNavigate();\r\n\r\n return (\r\n <EUIBrand\r\n // src={logo}\r\n alt=\"elseware Docs Engine\"\r\n onClick={() => navigate(\"/\")}\r\n className={classNames({\r\n \"inline-flex h-10 hover:cursor-pointer w-full items-center justify-center\": true,\r\n })}\r\n />\r\n );\r\n}\r\n\r\nexport default Brand;\r\n","import { useEffect } from \"react\";\r\n\r\nimport {\r\n useIsMobile,\r\n Drawer,\r\n DrawerToggler,\r\n useDrawer,\r\n Header as EUIHeader,\r\n ThemeSwitch,\r\n ShapeSwitch,\r\n} from \"elseware-ui\";\r\n\r\nimport Brand from \"../brand/Brand\";\r\n\r\nexport interface DocsHeaderProps {\r\n enableSidebar?: boolean;\r\n\r\n onToggleSidebar?: () => void;\r\n\r\n title?: string;\r\n\r\n logo?: React.ReactNode;\r\n}\r\n\r\nfunction Header({ enableSidebar = false, onToggleSidebar }: DocsHeaderProps) {\r\n const isMobile = useIsMobile();\r\n\r\n const {\r\n show: showMobile,\r\n openDrawer: openDrawerMobile,\r\n closeDrawer: closeDrawerMobile,\r\n } = useDrawer(false);\r\n\r\n useEffect(() => {\r\n if (!isMobile) {\r\n closeDrawerMobile();\r\n }\r\n }, [isMobile]);\r\n\r\n return (\r\n <EUIHeader position=\"fixed\" styles=\"px-3 py-1\">\r\n <div className=\"flex flex-row items-center justify-between\">\r\n {/* Left */}\r\n <div className=\"inline-flex items-center gap-3\">\r\n {enableSidebar && <DrawerToggler toggleDrawer={onToggleSidebar} />}\r\n <Brand />\r\n </div>\r\n\r\n {/* Right Desktop */}\r\n {!isMobile && (\r\n <div className=\"flex flex-row gap-3 items-center\">\r\n <ThemeSwitch />\r\n <ShapeSwitch />\r\n </div>\r\n )}\r\n\r\n {/* Right Mobile */}\r\n {isMobile && <DrawerToggler toggleDrawer={openDrawerMobile} />}\r\n </div>\r\n\r\n {/* Mobile Drawer */}\r\n <Drawer\r\n side=\"right\"\r\n visibility={showMobile}\r\n handleClose={closeDrawerMobile}\r\n >\r\n <div className=\"flex flex-col gap-4 p-4\">\r\n <div className=\"flex flex-row items-center justify-between\">\r\n <div className=\"flex flex-row gap-3 items-center\">\r\n <ThemeSwitch />\r\n <ShapeSwitch />\r\n </div>\r\n </div>\r\n </div>\r\n </Drawer>\r\n </EUIHeader>\r\n );\r\n}\r\n\r\nexport default Header;\r\n","// Hooks / Node modules / Styles\r\nimport { EUIProvider, ThemeProvider } from \"elseware-ui\";\r\n\r\n// Reducers / Actions\r\n\r\n// Utils / Functions\r\n\r\n// Components\r\n\r\n// Sub-Components\r\n\r\n// Data / Images / Icons\r\n\r\nfunction GenericLayout({ children }: any) {\r\n return (\r\n <EUIProvider\r\n config={{\r\n global: {\r\n shape: \"roundedSquare\",\r\n },\r\n }}\r\n >\r\n <ThemeProvider defaultTheme=\"dark\">\r\n <div>{children}</div>\r\n </ThemeProvider></EUIProvider>\r\n );\r\n}\r\n\r\nexport default GenericLayout;\r\n","import { Link } from \"react-router-dom\";\r\n\r\ninterface NotFoundProps {\r\n homeUrl: string;\r\n}\r\n\r\nfunction NotFound({ homeUrl }: NotFoundProps) {\r\n return (\r\n <div className=\"flex min-h-screen items-center justify-center bg-black px-6\">\r\n <div className=\"w-full max-w-lg rounded-2xl border border-gray-800 bg-neutral-950 p-10 shadow-2xl\">\r\n <div className=\"mb-4 text-6xl font-bold text-white\">404</div>\r\n\r\n <h1 className=\"mb-3 text-2xl font-semibold text-white\">\r\n Page not found\r\n </h1>\r\n\r\n <p className=\"mb-8 text-sm leading-relaxed text-gray-400\">\r\n The page you are looking for does not exist or may have been moved.\r\n </p>\r\n\r\n <Link\r\n to={homeUrl}\r\n className=\"inline-flex items-center rounded-lg bg-white px-5 py-2.5 text-sm font-medium text-black transition-all hover:opacity-90\"\r\n >\r\n Go to Home\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default NotFound;\r\n","import { useEffect } from \"react\";\r\n\r\nimport {\r\n Layout,\r\n Content,\r\n ContentArea,\r\n Drawer,\r\n Sidebar,\r\n DocumentationLayout,\r\n useDrawer,\r\n useIsMobile,\r\n} from \"elseware-ui\";\r\n\r\nimport { useNavigate, useLocation, useParams } from \"react-router-dom\";\r\n\r\nimport { generateSidebar } from \"../loaders/generateSidebar\";\r\n\r\nimport { useDocs } from \"../hooks/useDocs\";\r\n\r\nimport Header from \"../components/header/Header\";\r\n\r\nimport GenericLayout from \"./GenericLayout\";\r\n\r\nimport { findPageByPath, findFirstPage } from \"../utils/page\";\r\n\r\nimport NotFound from \"../components/not-found/NotFound\";\r\n\r\nfunction DocsLayout() {\r\n const { docs, basePath } = useDocs();\r\n\r\n const navigate = useNavigate();\r\n\r\n const location = useLocation();\r\n\r\n const params = useParams();\r\n\r\n const isMobile = useIsMobile();\r\n\r\n const { show, openDrawer, closeDrawer } = useDrawer(!isMobile);\r\n\r\n useEffect(() => {\r\n if (isMobile) {\r\n show && closeDrawer();\r\n } else {\r\n !show && openDrawer();\r\n }\r\n }, [isMobile]);\r\n\r\n const pagePath = params[\"*\"] ?? \"\";\r\n\r\n const page = findPageByPath(docs, pagePath);\r\n\r\n if (!page) {\r\n const firstPage = findFirstPage(docs) ?? \"/\";\r\n\r\n const homeUrl = `${basePath}${firstPage}`.replace(/\\/+/g, \"/\");\r\n\r\n return <NotFound homeUrl={homeUrl} />;\r\n }\r\n\r\n const sidebar = generateSidebar(docs, basePath);\r\n\r\n return (\r\n <GenericLayout>\r\n <Layout>\r\n {/* Header */}\r\n <Header enableSidebar onToggleSidebar={openDrawer} />\r\n\r\n {/* Content */}\r\n <Content sidebarVisible={!isMobile && show} styles=\"pt-[54px]\">\r\n {/* Sidebar */}\r\n <Drawer side=\"left\" visibility={show} handleClose={closeDrawer}>\r\n <Sidebar\r\n items={sidebar}\r\n navigate={navigate}\r\n currentPath={location.pathname}\r\n />\r\n </Drawer>\r\n\r\n {/* Documentation */}\r\n <ContentArea>\r\n <DocumentationLayout key={page.path} value={page.content} />\r\n </ContentArea>\r\n </Content>\r\n </Layout>\r\n </GenericLayout>\r\n );\r\n}\r\n\r\nexport default DocsLayout;\r\n","import React from \"react\";\r\n\r\nimport { RouteObject, Link } from \"react-router-dom\";\r\n\r\nimport DocsLayout from \"../layouts/DocsLayout\";\r\n\r\nimport { DocsCategory, DocsNode, DocsPage } from \"../types/docs\";\r\n\r\nimport NotFound from \"../components/not-found/NotFound\";\r\n\r\nimport { findFirstPage } from \"../utils/page\";\r\n\r\ninterface GenerateRoutesProps {\r\n docs: DocsCategory[];\r\n\r\n basePath?: string;\r\n}\r\n\r\nexport function generateRoutes({\r\n docs,\r\n basePath,\r\n}: GenerateRoutesProps): RouteObject[] {\r\n const firstPage = findFirstPage(docs) ?? \"/\";\r\n\r\n const homeUrl = `${basePath}${firstPage}`.replace(/\\/+/g, \"/\");\r\n\r\n return [\r\n {\r\n path: `/${basePath}/*`,\r\n\r\n element: <DocsLayout />,\r\n },\r\n\r\n {\r\n path: \"*\",\r\n\r\n element: <NotFound homeUrl={homeUrl} />,\r\n },\r\n ];\r\n}\r\n","import React from \"react\";\r\n\r\nimport { BrowserRouter, useRoutes } from \"react-router-dom\";\r\n\r\nimport DocsProvider from \"../context/DocsProvider\";\r\n\r\nimport { generateRoutes } from \"../router/generateRoutes\";\r\n\r\nimport { DocsCategory } from \"../types/docs\";\r\n\r\ninterface DocsRoutesProps {\r\n docs: DocsCategory[];\r\n basePath: string;\r\n}\r\n\r\ninterface DocsEngineProps {\r\n docs: DocsCategory[];\r\n basePath?: string;\r\n}\r\n\r\nfunction DocsRoutes({ docs, basePath }: DocsRoutesProps) {\r\n return useRoutes(\r\n generateRoutes({\r\n docs,\r\n basePath,\r\n }),\r\n );\r\n}\r\n\r\nfunction DocsEngine({ docs, basePath = \"/docs\" }: DocsEngineProps) {\r\n const normalizedBasePath = basePath.startsWith(\"/\")\r\n ? basePath\r\n : `/${basePath}`;\r\n\r\n return (\r\n <DocsProvider docs={docs} basePath={normalizedBasePath}>\r\n <BrowserRouter>\r\n <DocsRoutes docs={docs} basePath={normalizedBasePath} />\r\n </BrowserRouter>\r\n </DocsProvider>\r\n );\r\n}\r\n\r\nexport default DocsEngine;\r\n"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import'elseware-ui/styles.css';import {BrowserRouter,useRoutes,useNavigate,useLocation,useParams,Link}from'react-router-dom';import {createContext,useEffect,useContext}from'react';import {jsx,jsxs}from'react/jsx-runtime';import {useIsMobile,useDrawer,Layout,Content,Drawer,Sidebar,ContentArea,DocumentationLayout,EUIProvider,ThemeProvider,Header,DrawerToggler,ThemeSwitch,ShapeSwitch,Brand}from'elseware-ui';import G from'classnames';var f=createContext(void 0);function B({docs:e,basePath:t,children:o}){return jsx(f.Provider,{value:{docs:e,basePath:t},children:o})}var v=B;function h(e,t,o=""){for(let r of e){let i=`${o}${r.path}`.replace(/\/+/g,"/");if(m(r)){if(i.replace(/^\//,"")===t.replace(/^\//,""))return {...r,path:i};continue}let n=h(r.children,t,i);if(n)return n}return null}function m(e){return "content"in e}function d(e,t=""){for(let o of e){let r=`${t}${o.path}`.replace(/\/+/g,"/");if(m(o))return r;let i=d(o.children,r);if(i)return i}return null}function D(e,t,o=""){return e.map(r=>{let i=`${o}${r.path}`.replace(/\/+/g,"/");return m(r)?{type:"item",name:r.title,to:`/${t}${i}`.replace(/\/+/g,"/")}:{type:"group",name:r.title,items:D(r.children,t,i)}})}function k(e,t){return D(e,t)}function P(){let e=useContext(f);if(!e)throw new Error("useDocs must be used within DocsProvider");return e}function V(){let e=useNavigate();return jsx(Brand,{alt:"elseware Docs Engine",onClick:()=>e("/"),className:G({"inline-flex h-10 hover:cursor-pointer w-full items-center justify-center":true})})}var C=V;function Z({enableSidebar:e=false,onToggleSidebar:t}){let o=useIsMobile(),{show:r,openDrawer:i,closeDrawer:n}=useDrawer(false);return useEffect(()=>{o||n();},[o]),jsxs(Header,{position:"fixed",styles:"px-3 py-1",children:[jsxs("div",{className:"flex flex-row items-center justify-between",children:[jsxs("div",{className:"inline-flex items-center gap-3",children:[e&&jsx(DrawerToggler,{toggleDrawer:t}),jsx(C,{})]}),!o&&jsxs("div",{className:"flex flex-row gap-3 items-center",children:[jsx(ThemeSwitch,{}),jsx(ShapeSwitch,{})]}),o&&jsx(DrawerToggler,{toggleDrawer:i})]}),jsx(Drawer,{side:"right",visibility:r,handleClose:n,children:jsx("div",{className:"flex flex-col gap-4 p-4",children:jsx("div",{className:"flex flex-row items-center justify-between",children:jsxs("div",{className:"flex flex-row gap-3 items-center",children:[jsx(ThemeSwitch,{}),jsx(ShapeSwitch,{})]})})})})]})}var S=Z;function oe({children:e}){return jsx(EUIProvider,{config:{global:{shape:"roundedSquare"}},children:jsx(ThemeProvider,{defaultTheme:"dark",children:jsx("div",{children:e})})})}var E=oe;function ie({homeUrl:e}){return jsx("div",{className:"flex min-h-screen items-center justify-center bg-black px-6",children:jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-gray-800 bg-neutral-950 p-10 shadow-2xl",children:[jsx("div",{className:"mb-4 text-6xl font-bold text-white",children:"404"}),jsx("h1",{className:"mb-3 text-2xl font-semibold text-white",children:"Page not found"}),jsx("p",{className:"mb-8 text-sm leading-relaxed text-gray-400",children:"The page you are looking for does not exist or may have been moved."}),jsx(Link,{to:e,className:"inline-flex items-center rounded-lg bg-white px-5 py-2.5 text-sm font-medium text-black transition-all hover:opacity-90",children:"Go to Home"})]})})}var g=ie;function we(){let{docs:e,basePath:t}=P(),o=useNavigate(),r=useLocation(),i=useParams(),n=useIsMobile(),{show:p,openDrawer:y,closeDrawer:x}=useDrawer(!n);useEffect(()=>{n?p&&x():!p&&y();},[n]);let $=i["*"]??"",u=h(e,$);if(!u){let A=d(e)??"/",I=`${t}${A}`.replace(/\/+/g,"/");return jsx(g,{homeUrl:I})}let T=k(e,t);return jsx(E,{children:jsxs(Layout,{children:[jsx(S,{enableSidebar:true,onToggleSidebar:y}),jsxs(Content,{sidebarVisible:!n&&p,styles:"pt-[54px]",children:[jsx(Drawer,{side:"left",visibility:p,handleClose:x,children:jsx(Sidebar,{items:T,navigate:o,currentPath:r.pathname})}),jsx(ContentArea,{children:jsx(DocumentationLayout,{value:u.content},u.path)})]})]})})}var M=we;function L({docs:e,basePath:t}){let o=d(e)??"/",r=`${t}${o}`.replace(/\/+/g,"/");return [{path:`/${t}/*`,element:jsx(M,{})},{path:"*",element:jsx(g,{homeUrl:r})}]}function ve({docs:e,basePath:t}){return useRoutes(L({docs:e,basePath:t}))}function De({docs:e,basePath:t="/docs"}){let o=t.startsWith("/")?t:`/${t}`;return jsx(v,{docs:e,basePath:o,children:jsx(BrowserRouter,{children:jsx(ve,{docs:e,basePath:o})})})}var ke=De;
2
+ export{ke as DocsEngine};//# sourceMappingURL=index.mjs.map
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/context/DocsContext.ts","../src/context/DocsProvider.tsx","../src/utils/page.ts","../src/loaders/generateSidebar.ts","../src/hooks/useDocs.ts","../src/components/brand/Brand.tsx","../src/components/header/Header.tsx","../src/layouts/GenericLayout.tsx","../src/components/not-found/NotFound.tsx","../src/layouts/DocsLayout.tsx","../src/router/generateRoutes.tsx","../src/engine/DocsEngine.tsx"],"names":["DocsContext","createContext","DocsProvider","docs","basePath","children","jsx","DocsProvider_default","findPageByPath","nodes","targetPath","parentPath","node","fullPath","isPage","found","findFirstPage","nested","mapNodes","generateSidebar","useDocs","context","useContext","Brand","navigate","useNavigate","EUIBrand","classNames","Brand_default","Header","enableSidebar","onToggleSidebar","isMobile","useIsMobile","showMobile","openDrawerMobile","closeDrawerMobile","useDrawer","useEffect","jsxs","EUIHeader","DrawerToggler","ThemeSwitch","ShapeSwitch","Drawer","Header_default","GenericLayout","EUIProvider","ThemeProvider","GenericLayout_default","NotFound","homeUrl","Link","NotFound_default","DocsLayout","location","useLocation","params","useParams","show","openDrawer","closeDrawer","pagePath","page","firstPage","sidebar","Layout","Content","Sidebar","ContentArea","DocumentationLayout","DocsLayout_default","generateRoutes","DocsRoutes","useRoutes","DocsEngine","normalizedBasePath","BrowserRouter","DocsEngine_default"],"mappings":"kbAQO,IAAMA,EAAcC,aAAAA,CACzB,MACF,CAAA,CCEA,SAASC,CAAAA,CAAa,CAAE,IAAA,CAAAC,CAAAA,CAAM,QAAA,CAAAC,CAAAA,CAAU,SAAAC,CAAS,CAAA,CAAsB,CACrE,OACEC,GAAAA,CAACN,CAAAA,CAAY,SAAZ,CAAqB,KAAA,CAAO,CAAE,IAAA,CAAAG,CAAAA,CAAM,QAAA,CAAAC,CAAS,CAAA,CAC3C,QAAA,CAAAC,CAAAA,CACH,CAEJ,CAEA,IAAOE,EAAQL,CAAAA,CClBR,SAASM,CAAAA,CACdC,CAAAA,CACAC,EACAC,CAAAA,CAAa,EAAA,CACI,CACjB,IAAA,IAAWC,CAAAA,IAAQH,CAAAA,CAAO,CACxB,IAAMI,CAAAA,CAAW,CAAA,EAAGF,CAAU,CAAA,EAAGC,CAAAA,CAAK,IAAI,CAAA,CAAA,CAAG,OAAA,CAAQ,MAAA,CAAQ,GAAG,CAAA,CAEhE,GAAIE,EAAOF,CAAI,CAAA,CAAG,CAChB,GAAIC,CAAAA,CAAS,OAAA,CAAQ,MAAO,EAAE,CAAA,GAAMH,CAAAA,CAAW,OAAA,CAAQ,KAAA,CAAO,EAAE,EAC9D,OAAO,CACL,GAAGE,CAAAA,CAEH,IAAA,CAAMC,CACR,EAGF,QACF,CAEA,IAAME,CAAAA,CAAQP,CAAAA,CAAeI,CAAAA,CAAK,SAAUF,CAAAA,CAAYG,CAAQ,CAAA,CAEhE,GAAIE,CAAAA,CACF,OAAOA,CAEX,CA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AA,CAAYhD,CAAAA,CAAcb,CAAI,CAAA,EAAK,GAAA,CAEnCgD,CAAAA,CAAU,GAAG/C,CAAQ,CAAA,EAAG4D,CAAS,CAAA,CAAA,CAAG,OAAA,CAAQ,MAAA,CAAQ,GAAG,CAAA,CAE7D,OAAO,CACL,CACE,IAAA,CAAM,CAAA,CAAA,EAAI5D,CAAQ,CAAA,EAAA,CAAA,CAElB,OAAA,CAASE,GAAAA,CAACiE,CAAAA,CAAA,EAAW,CACvB,EAEA,CACE,IAAA,CAAM,GAAA,CAEN,OAAA,CAASjE,GAAAA,CAAC+C,CAAAA,CAAA,CAAS,OAAA,CAASF,CAAAA,CAAS,CACvC,CACF,CACF,CCnBA,SAASsB,EAAAA,CAAW,CAAE,IAAA,CAAAtE,EAAM,QAAA,CAAAC,CAAS,CAAA,CAAoB,CACvD,OAAOsE,SAAAA,CACLF,EAAe,CACb,IAAA,CAAArE,CAAAA,CACA,QAAA,CAAAC,CACF,CAAC,CACH,CACF,CAEA,SAASuE,EAAAA,CAAW,CAAE,IAAA,CAAAxE,EAAM,QAAA,CAAAC,CAAAA,CAAW,OAAQ,CAAA,CAAoB,CACjE,IAAMwE,EAAqBxE,CAAAA,CAAS,UAAA,CAAW,GAAG,CAAA,CAC9CA,CAAAA,CACA,CAAA,CAAA,EAAIA,CAAQ,CAAA,CAAA,CAEhB,OACEE,GAAAA,CAACC,CAAAA,CAAA,CAAa,IAAA,CAAMJ,EAAM,QAAA,CAAUyE,CAAAA,CAClC,QAAA,CAAAtE,GAAAA,CAACuE,aAAAA,CAAA,CACC,SAAAvE,GAAAA,CAACmE,EAAAA,CAAA,CAAW,IAAA,CAAMtE,CAAAA,CAAM,QAAA,CAAUyE,CAAAA,CAAoB,CAAA,CACxD,CAAA,CACF,CAEJ,CAEA,IAAOE,EAAAA,CAAQH","file":"index.mjs","sourcesContent":["import { createContext } from \"react\";\r\nimport { DocsCategory } from \"../types/docs\";\r\n\r\nexport interface DocsContextType {\r\n docs: DocsCategory[];\r\n basePath: string;\r\n}\r\n\r\nexport const DocsContext = createContext<DocsContextType | undefined>(\r\n undefined,\r\n);\r\n","import React from \"react\";\r\n\r\nimport { DocsContext } from \"./DocsContext\";\r\n\r\nimport { DocsCategory } from \"../types/docs\";\r\n\r\ninterface DocsProviderProps {\r\n docs: DocsCategory[];\r\n basePath: string;\r\n children: React.ReactNode;\r\n}\r\n\r\nfunction DocsProvider({ docs, basePath, children }: DocsProviderProps) {\r\n return (\r\n <DocsContext.Provider value={{ docs, basePath }}>\r\n {children}\r\n </DocsContext.Provider>\r\n );\r\n}\r\n\r\nexport default DocsProvider;\r\n","import { DocsNode, DocsPage } from \"../types/docs\";\r\n\r\nexport function findPageByPath(\r\n nodes: DocsNode[],\r\n targetPath: string,\r\n parentPath = \"\",\r\n): DocsPage | null {\r\n for (const node of nodes) {\r\n const fullPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n if (fullPath.replace(/^\\//, \"\") === targetPath.replace(/^\\//, \"\")) {\r\n return {\r\n ...node,\r\n\r\n path: fullPath,\r\n };\r\n }\r\n\r\n continue;\r\n }\r\n\r\n const found = findPageByPath(node.children, targetPath, fullPath);\r\n\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport interface ResolvedDocsPage extends DocsPage {\r\n id: string;\r\n fullPath: string;\r\n}\r\n\r\nexport function isPage(node: DocsNode): node is DocsPage {\r\n return \"content\" in node;\r\n}\r\n\r\nexport function resolveDocs(\r\n nodes: DocsNode[],\r\n parentPath = \"\",\r\n): ResolvedDocsPage[] {\r\n const pages: ResolvedDocsPage[] = [];\r\n\r\n nodes.forEach((node) => {\r\n const currentPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n pages.push({\r\n ...node,\r\n\r\n id: currentPath.replace(/\\//g, \"-\").replace(/^-/, \"\"),\r\n\r\n fullPath: currentPath,\r\n });\r\n\r\n return;\r\n }\r\n\r\n pages.push(...resolveDocs(node.children, currentPath));\r\n });\r\n\r\n return pages;\r\n}\r\n\r\nexport function findFirstPage(\r\n nodes: DocsNode[],\r\n parentPath = \"\",\r\n): string | null {\r\n for (const node of nodes) {\r\n const fullPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n return fullPath;\r\n }\r\n\r\n const nested = findFirstPage(node.children, fullPath);\r\n\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n","import { MenuNode } from \"elseware-ui\";\r\n\r\nimport { DocsCategory, DocsNode, DocsPage } from \"../types/docs\";\r\n\r\nimport { isPage } from \"../utils/page\";\r\n\r\nfunction mapNodes(\r\n nodes: DocsNode[],\r\n basePath: string,\r\n parentPath = \"\",\r\n): MenuNode[] {\r\n return nodes.map((node) => {\r\n const fullPath = `${parentPath}${node.path}`.replace(/\\/+/g, \"/\");\r\n\r\n if (isPage(node)) {\r\n return {\r\n type: \"item\",\r\n\r\n name: node.title,\r\n\r\n to: `/${basePath}${fullPath}`.replace(/\\/+/g, \"/\"),\r\n };\r\n }\r\n\r\n return {\r\n type: \"group\",\r\n\r\n name: node.title,\r\n\r\n items: mapNodes(node.children, basePath, fullPath),\r\n };\r\n });\r\n}\r\n\r\nexport function generateSidebar(\r\n docs: DocsCategory[],\r\n\r\n basePath: string,\r\n): MenuNode[] {\r\n return mapNodes(docs, basePath);\r\n}\r\n","import { useContext } from \"react\";\r\n\r\nimport { DocsContext } from \"../context/DocsContext\";\r\n\r\nexport function useDocs() {\r\n const context = useContext(DocsContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDocs must be used within DocsProvider\");\r\n }\r\n\r\n return context;\r\n}\r\n","// Hooks / Node modules / Styles\r\nimport classNames from \"classnames\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { Brand as EUIBrand } from \"elseware-ui\";\r\n\r\n// Reducers / Actions\r\n\r\n// Utils / Functions\r\n\r\n// Components\r\n\r\n// Sub-Components\r\n\r\n// Data / Images / Icons\r\n\r\nfunction Brand() {\r\n const navigate = useNavigate();\r\n\r\n return (\r\n <EUIBrand\r\n // src={logo}\r\n alt=\"elseware Docs Engine\"\r\n onClick={() => navigate(\"/\")}\r\n className={classNames({\r\n \"inline-flex h-10 hover:cursor-pointer w-full items-center justify-center\": true,\r\n })}\r\n />\r\n );\r\n}\r\n\r\nexport default Brand;\r\n","import { useEffect } from \"react\";\r\n\r\nimport {\r\n useIsMobile,\r\n Drawer,\r\n DrawerToggler,\r\n useDrawer,\r\n Header as EUIHeader,\r\n ThemeSwitch,\r\n ShapeSwitch,\r\n} from \"elseware-ui\";\r\n\r\nimport Brand from \"../brand/Brand\";\r\n\r\nexport interface DocsHeaderProps {\r\n enableSidebar?: boolean;\r\n\r\n onToggleSidebar?: () => void;\r\n\r\n title?: string;\r\n\r\n logo?: React.ReactNode;\r\n}\r\n\r\nfunction Header({ enableSidebar = false, onToggleSidebar }: DocsHeaderProps) {\r\n const isMobile = useIsMobile();\r\n\r\n const {\r\n show: showMobile,\r\n openDrawer: openDrawerMobile,\r\n closeDrawer: closeDrawerMobile,\r\n } = useDrawer(false);\r\n\r\n useEffect(() => {\r\n if (!isMobile) {\r\n closeDrawerMobile();\r\n }\r\n }, [isMobile]);\r\n\r\n return (\r\n <EUIHeader position=\"fixed\" styles=\"px-3 py-1\">\r\n <div className=\"flex flex-row items-center justify-between\">\r\n {/* Left */}\r\n <div className=\"inline-flex items-center gap-3\">\r\n {enableSidebar && <DrawerToggler toggleDrawer={onToggleSidebar} />}\r\n <Brand />\r\n </div>\r\n\r\n {/* Right Desktop */}\r\n {!isMobile && (\r\n <div className=\"flex flex-row gap-3 items-center\">\r\n <ThemeSwitch />\r\n <ShapeSwitch />\r\n </div>\r\n )}\r\n\r\n {/* Right Mobile */}\r\n {isMobile && <DrawerToggler toggleDrawer={openDrawerMobile} />}\r\n </div>\r\n\r\n {/* Mobile Drawer */}\r\n <Drawer\r\n side=\"right\"\r\n visibility={showMobile}\r\n handleClose={closeDrawerMobile}\r\n >\r\n <div className=\"flex flex-col gap-4 p-4\">\r\n <div className=\"flex flex-row items-center justify-between\">\r\n <div className=\"flex flex-row gap-3 items-center\">\r\n <ThemeSwitch />\r\n <ShapeSwitch />\r\n </div>\r\n </div>\r\n </div>\r\n </Drawer>\r\n </EUIHeader>\r\n );\r\n}\r\n\r\nexport default Header;\r\n","// Hooks / Node modules / Styles\r\nimport { EUIProvider, ThemeProvider } from \"elseware-ui\";\r\n\r\n// Reducers / Actions\r\n\r\n// Utils / Functions\r\n\r\n// Components\r\n\r\n// Sub-Components\r\n\r\n// Data / Images / Icons\r\n\r\nfunction GenericLayout({ children }: any) {\r\n return (\r\n <EUIProvider\r\n config={{\r\n global: {\r\n shape: \"roundedSquare\",\r\n },\r\n }}\r\n >\r\n <ThemeProvider defaultTheme=\"dark\">\r\n <div>{children}</div>\r\n </ThemeProvider></EUIProvider>\r\n );\r\n}\r\n\r\nexport default GenericLayout;\r\n","import { Link } from \"react-router-dom\";\r\n\r\ninterface NotFoundProps {\r\n homeUrl: string;\r\n}\r\n\r\nfunction NotFound({ homeUrl }: NotFoundProps) {\r\n return (\r\n <div className=\"flex min-h-screen items-center justify-center bg-black px-6\">\r\n <div className=\"w-full max-w-lg rounded-2xl border border-gray-800 bg-neutral-950 p-10 shadow-2xl\">\r\n <div className=\"mb-4 text-6xl font-bold text-white\">404</div>\r\n\r\n <h1 className=\"mb-3 text-2xl font-semibold text-white\">\r\n Page not found\r\n </h1>\r\n\r\n <p className=\"mb-8 text-sm leading-relaxed text-gray-400\">\r\n The page you are looking for does not exist or may have been moved.\r\n </p>\r\n\r\n <Link\r\n to={homeUrl}\r\n className=\"inline-flex items-center rounded-lg bg-white px-5 py-2.5 text-sm font-medium text-black transition-all hover:opacity-90\"\r\n >\r\n Go to Home\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default NotFound;\r\n","import { useEffect } from \"react\";\r\n\r\nimport {\r\n Layout,\r\n Content,\r\n ContentArea,\r\n Drawer,\r\n Sidebar,\r\n DocumentationLayout,\r\n useDrawer,\r\n useIsMobile,\r\n} from \"elseware-ui\";\r\n\r\nimport { useNavigate, useLocation, useParams } from \"react-router-dom\";\r\n\r\nimport { generateSidebar } from \"../loaders/generateSidebar\";\r\n\r\nimport { useDocs } from \"../hooks/useDocs\";\r\n\r\nimport Header from \"../components/header/Header\";\r\n\r\nimport GenericLayout from \"./GenericLayout\";\r\n\r\nimport { findPageByPath, findFirstPage } from \"../utils/page\";\r\n\r\nimport NotFound from \"../components/not-found/NotFound\";\r\n\r\nfunction DocsLayout() {\r\n const { docs, basePath } = useDocs();\r\n\r\n const navigate = useNavigate();\r\n\r\n const location = useLocation();\r\n\r\n const params = useParams();\r\n\r\n const isMobile = useIsMobile();\r\n\r\n const { show, openDrawer, closeDrawer } = useDrawer(!isMobile);\r\n\r\n useEffect(() => {\r\n if (isMobile) {\r\n show && closeDrawer();\r\n } else {\r\n !show && openDrawer();\r\n }\r\n }, [isMobile]);\r\n\r\n const pagePath = params[\"*\"] ?? \"\";\r\n\r\n const page = findPageByPath(docs, pagePath);\r\n\r\n if (!page) {\r\n const firstPage = findFirstPage(docs) ?? \"/\";\r\n\r\n const homeUrl = `${basePath}${firstPage}`.replace(/\\/+/g, \"/\");\r\n\r\n return <NotFound homeUrl={homeUrl} />;\r\n }\r\n\r\n const sidebar = generateSidebar(docs, basePath);\r\n\r\n return (\r\n <GenericLayout>\r\n <Layout>\r\n {/* Header */}\r\n <Header enableSidebar onToggleSidebar={openDrawer} />\r\n\r\n {/* Content */}\r\n <Content sidebarVisible={!isMobile && show} styles=\"pt-[54px]\">\r\n {/* Sidebar */}\r\n <Drawer side=\"left\" visibility={show} handleClose={closeDrawer}>\r\n <Sidebar\r\n items={sidebar}\r\n navigate={navigate}\r\n currentPath={location.pathname}\r\n />\r\n </Drawer>\r\n\r\n {/* Documentation */}\r\n <ContentArea>\r\n <DocumentationLayout key={page.path} value={page.content} />\r\n </ContentArea>\r\n </Content>\r\n </Layout>\r\n </GenericLayout>\r\n );\r\n}\r\n\r\nexport default DocsLayout;\r\n","import React from \"react\";\r\n\r\nimport { RouteObject, Link } from \"react-router-dom\";\r\n\r\nimport DocsLayout from \"../layouts/DocsLayout\";\r\n\r\nimport { DocsCategory, DocsNode, DocsPage } from \"../types/docs\";\r\n\r\nimport NotFound from \"../components/not-found/NotFound\";\r\n\r\nimport { findFirstPage } from \"../utils/page\";\r\n\r\ninterface GenerateRoutesProps {\r\n docs: DocsCategory[];\r\n\r\n basePath?: string;\r\n}\r\n\r\nexport function generateRoutes({\r\n docs,\r\n basePath,\r\n}: GenerateRoutesProps): RouteObject[] {\r\n const firstPage = findFirstPage(docs) ?? \"/\";\r\n\r\n const homeUrl = `${basePath}${firstPage}`.replace(/\\/+/g, \"/\");\r\n\r\n return [\r\n {\r\n path: `/${basePath}/*`,\r\n\r\n element: <DocsLayout />,\r\n },\r\n\r\n {\r\n path: \"*\",\r\n\r\n element: <NotFound homeUrl={homeUrl} />,\r\n },\r\n ];\r\n}\r\n","import React from \"react\";\r\n\r\nimport { BrowserRouter, useRoutes } from \"react-router-dom\";\r\n\r\nimport DocsProvider from \"../context/DocsProvider\";\r\n\r\nimport { generateRoutes } from \"../router/generateRoutes\";\r\n\r\nimport { DocsCategory } from \"../types/docs\";\r\n\r\ninterface DocsRoutesProps {\r\n docs: DocsCategory[];\r\n basePath: string;\r\n}\r\n\r\ninterface DocsEngineProps {\r\n docs: DocsCategory[];\r\n basePath?: string;\r\n}\r\n\r\nfunction DocsRoutes({ docs, basePath }: DocsRoutesProps) {\r\n return useRoutes(\r\n generateRoutes({\r\n docs,\r\n basePath,\r\n }),\r\n );\r\n}\r\n\r\nfunction DocsEngine({ docs, basePath = \"/docs\" }: DocsEngineProps) {\r\n const normalizedBasePath = basePath.startsWith(\"/\")\r\n ? basePath\r\n : `/${basePath}`;\r\n\r\n return (\r\n <DocsProvider docs={docs} basePath={normalizedBasePath}>\r\n <BrowserRouter>\r\n <DocsRoutes docs={docs} basePath={normalizedBasePath} />\r\n </BrowserRouter>\r\n </DocsProvider>\r\n );\r\n}\r\n\r\nexport default DocsEngine;\r\n"]}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "elseware-docs-engine",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "description": "React documentation engine by elseware Technology",
6
+ "license": "MIT",
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.mjs",
9
+ "types": "./dist/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.mjs",
16
+ "require": "./dist/index.js",
17
+ "types": "./dist/index.d.ts"
18
+ },
19
+ "./dist/index.css": "./dist/index.css"
20
+ },
21
+ "sideEffects": [
22
+ "*.css"
23
+ ],
24
+ "keywords": [
25
+ "docs",
26
+ "documentation",
27
+ "react",
28
+ "markdown",
29
+ "mdx",
30
+ "vite"
31
+ ],
32
+ "peerDependencies": {
33
+ "react": "^18",
34
+ "react-dom": "^18"
35
+ },
36
+ "dependencies": {
37
+ "elseware-ui": "^2.27.10",
38
+ "react-router-dom": "^6"
39
+ },
40
+ "devDependencies": {
41
+ "@tailwindcss/postcss": "^4.1.16",
42
+ "@types/react": "^18.2.66",
43
+ "@types/react-dom": "^18.2.22",
44
+ "@vitejs/plugin-react": "^4.2.1",
45
+ "autoprefixer": "^10.4.21",
46
+ "prettier": "^3.8.3",
47
+ "prettier-plugin-tailwindcss": "^0.6.14",
48
+ "rimraf": "^6.1.3",
49
+ "tailwindcss": "^3.4.0",
50
+ "tsup": "^8.0.2",
51
+ "typescript": "^5.4.5",
52
+ "vite": "^5.2.0"
53
+ },
54
+ "scripts": {
55
+ "dev": "vite",
56
+ "build": "rimraf dist && tsup",
57
+ "typecheck": "tsc --noEmit",
58
+ "clean": "rimraf dist node_modules/.cache",
59
+ "prepublishOnly": "npm run build",
60
+ "release": "npm publish --access public"
61
+ }
62
+ }