kireji 0.7.3 → 0.8.2
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 +4 -4
- package/package.json +1 -1
- package/src/app/kireji/description +1 -1
- package/src/app/kireji/editor/sections/state-space/part.html_.js +5 -5
- package/src/app/kireji/editor/static.css +7 -0
- package/src/app/kireji/editor/tab-group/mathML-subpart.js +8 -0
- package/src/app/kireji/sidebar/static.css +51 -15
- package/src/app/kireji/static.css +0 -4
- package/src/app/kireji/tool-bar/part.css +1 -1
- package/src/application-goto.js +8 -5
- package/src/build.js +89 -13
- package/src/kireji.schema.json +205 -0
- package/src/part.css_.js +20 -0
- package/src/part.html_.js +20 -8
- package/src/parts/abstract/clip/mathML-subpart.js +4 -0
- package/src/parts/abstract/match/mathML-subpart.js +9 -0
- package/src/parts/abstract/mesh/data-get.js +11 -0
- package/src/parts/abstract/mesh/mathML-subpart.js +10 -0
- package/src/parts/abstract/mesh/ray-cast.js +4 -4
- package/src/parts/abstract/mesh/type.d.ts +10 -0
- package/src/parts/abstract/mix/mathML-subpart.js +9 -0
- package/src/parts/abstract/part/mathML-subpart.js +3 -0
- package/src/parts/abstract/part/mathML.js +22 -0
- package/src/parts/abstract/part/part.json +11 -0
- package/src/parts/abstract/part/type.d.ts +4 -0
- package/src/parts/abstract/part-mask/mathML-subpart.js +1 -0
- package/src/parts/abstract/part-outliner/itemHTML-recursive.js +1 -1
- package/src/parts/abstract/part.json +1 -1
- package/src/parts/abstract/permutation/mathML-subpart.js +10 -0
- package/src/parts/abstract/scroller/mathML-subpart.js +1 -0
- package/src/parts/abstract/scroller/onscroll.js +3 -1
- package/src/parts/abstract/scroller/point-thumb.js +1 -1
- package/src/parts/core/client/async-install.js +1 -1
- package/src/parts/core/part.json +1 -1
- package/src/parts/core/server/sync-install.js +1 -1
- package/src/parts/core/worker/async-take-control.js +1 -1
- package/src/parts/desktop/era/modern/part.css +5 -1
- package/src/parts/desktop/era/vintage/static.css +5 -1
- package/src/parts/desktop/task-bar/menu/menu.html_.js +23 -12
- package/src/parts/desktop/task-bar/part.html_.js +3 -1
- package/src/parts/desktop/task-bar/view-hydrate.js +1 -1
- package/src/parts/desktop/type.d.ts +5 -5
- package/src/parts/desktop/windows/point.js +1 -1
- package/src/parts/desktop/windows/superset-get.js +1 -1
- package/src/{part.css → static.css} +1 -10
- package/src/type.d.ts +172 -10
- package/src/validate.js +3 -3
- package/src/app/kireji/editor/tab-group/equation.html_.js +0 -42
- package/src/parts/abstract/boolean/equation-variable.html +0 -1
- package/src/parts/abstract/box/build.js +0 -24
- package/src/parts/abstract/box/constants.js +0 -1
- package/src/parts/abstract/box/description-abstract +0 -1
- package/src/parts/abstract/box/dimensions_.js +0 -1
- package/src/parts/abstract/box/equation.html_.js +0 -1
- package/src/parts/abstract/box/model_.js +0 -1
- package/src/parts/abstract/box/part.json +0 -3
- package/src/parts/abstract/box/routeID-distribute.js +0 -7
- package/src/parts/abstract/box/routeID-model-to.js +0 -18
- package/src/parts/abstract/box/title-abstract +0 -1
- package/src/parts/abstract/box/type.d.ts +0 -20
- package/src/parts/abstract/match/equation.html_.js +0 -11
- package/src/parts/abstract/mix/equation.html_.js +0 -11
- package/src/parts/abstract/part/equation-variable.html_.js +0 -1
- package/src/parts/abstract/part/equation.html_.js +0 -3
- package/src/parts/abstract/part-mask/equation-variable.html_.js +0 -1
- package/src/parts/abstract/part-mask/equation.html_.js +0 -1
- package/src/parts/abstract/permutation/equation.html_.js +0 -1
- package/src/parts/abstract/scroller/equation-variable.html +0 -1
- package/src/parts/abstract/scroller/equation.html +0 -1
- package/src/parts/user/part.json +0 -3
- package/src/parts/user/title +0 -1
- package/src/parts/user/type.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Kireji - *Web Framework*
|
|
2
2
|
> **<sub>Part of the Kireji Project</sub>**<br><sup><i>omnia ex una linea</i></sup>
|
|
3
3
|
|
|
4
|
-
The **Kireji Web Framework** is a reactive full-stack web framework that
|
|
4
|
+
The **Kireji Web Framework** is a reactive full-stack web framework that can build and serve web apps and multi-origin web app ecosystems. It stores its runtime state in its routing system, achieving the information-theoretic lower bound of data compression. This enables comprehensive deep linking, session bookmarking without user accounts or local storage, peer-to-peer data sharing without uploads or accounts, and cross-origin communication without cookies or CORS.
|
|
5
5
|
## The Kireji Project
|
|
6
6
|
The Kireji Project poses a question: **What if we could treat every web page as a point in a unified, mathematically mapped space?**
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ The Kireji Project poses a question: **What if we could treat every web page as
|
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
|
-
> <sub>Note: This framework is currently
|
|
16
|
+
> <sub>Note: This framework is currently in alpha. Expect breaking changes with each version. Check out the [Demo App Ecosystem](https://github.com/kireji-app/demo#readme) to see a live project that uses this framework. Check back later to see if the framework has advanced into beta.</sub>
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
# In an empty git repo.
|
|
@@ -104,8 +104,8 @@ The Kireji Project is in **early research and development**.
|
|
|
104
104
|
|
|
105
105
|
[](https://www.npmjs.com/kireji)
|
|
106
106
|
<br>[](https://www.repostatus.org/#alpha)
|
|
107
|
-
<br>[](https://github.com/kireji-app/
|
|
108
|
-
<br>[](https://github.com/kireji-app/
|
|
107
|
+
<br>[](https://github.com/kireji-app/kireji/commits/)
|
|
108
|
+
<br>[](https://github.com/kireji-app/kireji)
|
|
109
109
|
<br>[](http://www.ejaugust.com/)
|
|
110
110
|
<br>[](https://github.com/kireji-app/kireji/LICENSE.md)
|
|
111
111
|
<br>[](https://github.com/sponsors/EJAugust)
|
package/package.json
CHANGED
|
@@ -4,4 +4,4 @@ By clicking on a part in the sidebar, you can view the properties of that part a
|
|
|
4
4
|
|
|
5
5
|
The properties also allow you to view the list of the files which are associated with each part and to see the current state of each part and its corresponding base 64 hash. These values update in real-time as you interact with any of the apps.
|
|
6
6
|
|
|
7
|
-
You can travel away from this application, make changes in other applications, and then return here to see how those cross-origin interactions have impacted each part
|
|
7
|
+
You can travel away from this application, make changes in other applications, and then return here to see how those cross-origin interactions have impacted each part of the ecosystem.
|
|
@@ -3,14 +3,14 @@ const cardinalityAsString = instances.includes(activePart) ? activePartCardinali
|
|
|
3
3
|
|
|
4
4
|
return (
|
|
5
5
|
instances.includes(activePart) ? (
|
|
6
|
+
`<h3>Equation</h3>` +
|
|
7
|
+
activePart.mathML(1 + (activePart.length <= 4), "variable") +
|
|
8
|
+
`<hr>` +
|
|
6
9
|
"<h3>Cardinality</h3>" +
|
|
7
|
-
|
|
10
|
+
activePart.mathML(0, "value") +
|
|
8
11
|
`<hr>` +
|
|
9
12
|
"<h3>Hartley Entropy</h3>" +
|
|
10
|
-
`<
|
|
11
|
-
`<hr>` +
|
|
12
|
-
`<h3>Equation</h3>` +
|
|
13
|
-
"<math>" + activePart["equation-variable.html"] + "<mo>=</mo>" + activePart["equation.html"] + "</math>"
|
|
13
|
+
`<math><mn>${toCharms(activePartCardinality, false)}</mn><mspace width=".5ch"/><mtext>charms</mtext><mspace width=".5ch"/><mo>(</mo><mn>${toBits(activePartCardinality, false)}</mn><mspace width=".5ch"/><mtext>bits</mtext><mo>)</mo></math>`
|
|
14
14
|
) : (
|
|
15
15
|
"<p class=disabled-message>Abstract parts do not have a concrete state space.</p>"
|
|
16
16
|
)
|
|
@@ -354,6 +354,13 @@ body.vintage #kireji_app editor-::after {
|
|
|
354
354
|
pointer-events: none;
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
body.vintage #kireji_app #info-state-space>section>math {
|
|
358
|
+
text-align: right;
|
|
359
|
+
margin: calc(.5 * var(--spacing));
|
|
360
|
+
width: min-content;
|
|
361
|
+
justify-self: end;
|
|
362
|
+
}
|
|
363
|
+
|
|
357
364
|
@container editor-view (width > 350px) {
|
|
358
365
|
body.vintage #kireji_app #info-state-space>section {
|
|
359
366
|
display: grid;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const n_tabs = allSubjects.length
|
|
2
|
+
|
|
3
|
+
return [
|
|
4
|
+
"<mn>1</mn>",
|
|
5
|
+
"<mo>+</mo>",
|
|
6
|
+
`<munderover><mo>∑</mo><mrow><msub><mi>𝑛</mi><mi>tabs</mi></msub><mo>=</mo><mn>1</mn></mrow><mi>${n_tabs}</mi></munderover><mrow><msub><mi>𝑛</mi><mi>tabs</mi></msub><mo>(</mo><msub><mi>𝑛</mi><mi>tabs</mi></msub><mo>+</mo><mn>1</mn><mo>)</mo></mrow>`,
|
|
7
|
+
`<munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow><msub><mi>𝑛</mi><mi>tabs</mi></msub></mrow></munderover><mrow><mo>(</mo><mi>${n_tabs}</mi><mo>-</mo><mi>i</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>`
|
|
8
|
+
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#kireji_app
|
|
1
|
+
#kireji_app>side-bar {
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: var(--tool-bar-width);
|
|
@@ -6,6 +6,29 @@
|
|
|
6
6
|
bottom: 0;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
@media (width > 424px) {
|
|
10
|
+
|
|
11
|
+
#kireji_app:has(side-bar) {
|
|
12
|
+
--sidebar-width: calc(var(--tool-bar-width) + var(--sidebar-view-width));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media (width < 425px) {
|
|
17
|
+
|
|
18
|
+
#kireji_app:has(side-bar)>editor- {
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#kireji_app>width-handle {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#kireji_app>side-bar {
|
|
27
|
+
z-index: 10000;
|
|
28
|
+
width: calc(var(--app-width) - var(--tool-bar-width));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
9
32
|
#kireji_app #sidebar-view-header {
|
|
10
33
|
position: absolute;
|
|
11
34
|
z-index: 10;
|
|
@@ -92,26 +115,31 @@
|
|
|
92
115
|
position: relative;
|
|
93
116
|
}
|
|
94
117
|
|
|
95
|
-
#kireji_app #sidebar-view summary>.explore-toggle,
|
|
96
|
-
#kireji_app #sidebar-view summary>img,
|
|
97
|
-
#kireji_app #sidebar-view svg {
|
|
98
|
-
height: var(--tab-icon-size);
|
|
99
|
-
width: var(--tab-icon-size);
|
|
100
|
-
margin: calc((var(--tab-line-height) - var(--tab-icon-size)) / 2);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
118
|
#kireji_app outliner-spacer {
|
|
104
|
-
width: calc(var(--tab-line-height) / 2);
|
|
119
|
+
width: calc(var(--depth) * var(--tab-line-height) / 2);
|
|
105
120
|
border-radius: 0;
|
|
106
|
-
|
|
121
|
+
background:
|
|
122
|
+
linear-gradient(to right, transparent 0%, transparent calc(100% - 1px), var(--bg-un-mode) calc(100% - 1px), var(--bg-un-mode) 100%) 0 0 / calc(var(--tab-line-height) / 2) var(--tab-line-height);
|
|
123
|
+
/* border-right: 1px solid var(--bg-un-mode); */
|
|
107
124
|
}
|
|
108
125
|
|
|
109
126
|
#kireji_app outliner-spacer:has(+ img) {
|
|
110
|
-
|
|
127
|
+
width: calc((var(--depth) - 1) * var(--tab-line-height) / 2);
|
|
128
|
+
margin-right: var(--tab-line-height);
|
|
111
129
|
}
|
|
112
130
|
|
|
113
|
-
|
|
114
|
-
|
|
131
|
+
/*
|
|
132
|
+
#kireji_app details.empty>summary>outliner-spacer:last-of-type {
|
|
133
|
+
border: none;
|
|
134
|
+
}
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
#kireji_app #sidebar-view summary>.explore-toggle,
|
|
138
|
+
#kireji_app #sidebar-view summary>img,
|
|
139
|
+
#kireji_app #sidebar-view svg {
|
|
140
|
+
height: var(--tab-icon-size);
|
|
141
|
+
width: var(--tab-icon-size);
|
|
142
|
+
margin: calc((var(--tab-line-height) - var(--tab-icon-size)) / 2);
|
|
115
143
|
}
|
|
116
144
|
|
|
117
145
|
#kireji_app #sidebar-view summary .label {
|
|
@@ -152,13 +180,21 @@ body.modern #kireji_app #sidebar-view summary {
|
|
|
152
180
|
|
|
153
181
|
/* Vintage */
|
|
154
182
|
|
|
155
|
-
body.vintage #kireji_app
|
|
183
|
+
body.vintage #kireji_app>side-bar {
|
|
156
184
|
top: 6px;
|
|
157
185
|
width: calc(var(--sidebar-view-width) - (var(--handle-thickness) / 2) - 2px);
|
|
158
186
|
left: calc(6px + var(--tool-bar-width));
|
|
159
187
|
bottom: 6px;
|
|
160
188
|
}
|
|
161
189
|
|
|
190
|
+
|
|
191
|
+
@media (width < 425px) {
|
|
192
|
+
|
|
193
|
+
body.vintage #kireji_app>side-bar {
|
|
194
|
+
width: calc(var(--app-width) - var(--tool-bar-width) - 12px);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
162
198
|
body.vintage #kireji_app side-bar::after {
|
|
163
199
|
content: "";
|
|
164
200
|
position: absolute;
|
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
overscroll-behavior: none;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
#kireji_app:has(side-bar) {
|
|
9
|
-
--sidebar-width: calc(var(--tool-bar-width) + var(--sidebar-view-width));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
body.modern {
|
|
13
9
|
--tab-group-height: calc(var(--tab-line-height) + var(--spacing) / 1.5);
|
|
14
10
|
--tab-line-height: 26px;
|
|
@@ -27,7 +27,7 @@ body.modern #kireji_app tool-bar {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
body.modern #kireji_app:has(side-bar) tool-bar>button[data-active] {
|
|
30
|
-
box-shadow: inset
|
|
30
|
+
box-shadow: inset -5px 0 0 -1px var(--accent);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
body.vintage #kireji_app tool-bar {
|
package/src/application-goto.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
const targetLocation = (+_.local ? `http://${HOST}.localhost:${_.port}` : `https://${HOST}`) + encodePathname(_.routeID)
|
|
2
2
|
document.body.classList.add("unhydrated")
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
4
|
+
if (_.includeDesktop === "demo" || (!production && (_.includeDesktop === "full" || _.includeDesktop === 'local-only'))) {
|
|
5
|
+
|
|
6
|
+
// Press the task-bar button before navigation starts.
|
|
7
|
+
const instanceIndex = desktop.windows.instances.findIndex(window => window.application.host === HOST)
|
|
8
|
+
if (instanceIndex !== -1) {
|
|
9
|
+
const task = document.querySelectorAll(`task-bar>button.task`)[instanceIndex]
|
|
10
|
+
task.classList.add("preview-pressed", "pressed")
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
location = targetLocation
|
package/src/build.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/** @type {(_: IEcosystem, compressedSubjectOrigins: string) => void} */
|
|
2
4
|
function ƒ(_, compressedSubjectOrigins) {
|
|
3
5
|
|
|
4
6
|
// Initialization
|
|
@@ -520,7 +522,7 @@ function ƒ(_, compressedSubjectOrigins) {
|
|
|
520
522
|
packAndMap(url) {
|
|
521
523
|
const sourceFile = this
|
|
522
524
|
const script = sourceFile.lines.join("\n")
|
|
523
|
-
return
|
|
525
|
+
return _.mapping === "enabled"
|
|
524
526
|
? script +
|
|
525
527
|
`
|
|
526
528
|
//${"#"} sourceMappingURL=data:application/json;charset=utf-8;base64,${btoaUnicode(sourceFile.getMap())}${url
|
|
@@ -591,7 +593,6 @@ function ƒ(_, compressedSubjectOrigins) {
|
|
|
591
593
|
imageSources = [],
|
|
592
594
|
earlyImageSources = [],
|
|
593
595
|
partsByHost = {},
|
|
594
|
-
preHydrationArchive = serialize(_),
|
|
595
596
|
resolveRelativeHost = (relativeHost, base) => {
|
|
596
597
|
|
|
597
598
|
if (typeof relativeHost !== "string")
|
|
@@ -891,8 +892,74 @@ function ƒ(_, compressedSubjectOrigins) {
|
|
|
891
892
|
part.inheritors.sort((a, b) => (b.totalInheritors - a.totalInheritors) || (a.host > b.host ? 1 : -1))
|
|
892
893
|
|
|
893
894
|
return totalInheritors
|
|
895
|
+
},
|
|
896
|
+
configureArchiveContent = () => {
|
|
897
|
+
// TODO: Consider merging user landing model with stock landing model instead of replacing it.
|
|
898
|
+
const landingModel = JSON.parse(_["landing-model.json"])
|
|
899
|
+
|
|
900
|
+
let desktopFeatures = 3
|
|
901
|
+
|
|
902
|
+
if (_.includeColor === "none") {
|
|
903
|
+
delete _.parts.desktop.color
|
|
904
|
+
delete landingModel.parts.desktop.color
|
|
905
|
+
desktopFeatures--
|
|
906
|
+
} else if (_.includeColor === "dark" || (_.includeColor === "debug-light" && production)) {
|
|
907
|
+
delete _.parts.desktop.color.light
|
|
908
|
+
landingModel.parts.desktop.color = "light"
|
|
909
|
+
} else if (_.includeColor === "light" || (_.includeColor === "debug-dark" && production)) {
|
|
910
|
+
delete _.parts.desktop.color.dark
|
|
911
|
+
landingModel.parts.desktop.color = "dark"
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
if (_.includeEra === "none") {
|
|
915
|
+
delete _.parts.desktop.era
|
|
916
|
+
delete landingModel.parts.desktop.era
|
|
917
|
+
desktopFeatures--
|
|
918
|
+
} else if (_.includeEra === "vintage" || (_.includeEra === "debug-modern" && production)) {
|
|
919
|
+
delete _.parts.desktop.era.modern
|
|
920
|
+
landingModel.parts.desktop.era = "vintage"
|
|
921
|
+
} else if (_.includeEra === "modern" || (_.includeEra === "debug-vintage" && production)) {
|
|
922
|
+
delete _.parts.desktop.era.vintage
|
|
923
|
+
landingModel.parts.desktop.era = "modern"
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
if (_.includeKirejiApp === "none" || (_.includeKirejiApp === "full" && production)) {
|
|
927
|
+
delete _.app
|
|
928
|
+
delete landingModel.app
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const removeDesktopFeatures = () => {
|
|
932
|
+
delete _.parts.desktop.icons
|
|
933
|
+
delete landingModel.parts.desktop.icons
|
|
934
|
+
delete _.parts.desktop.windows
|
|
935
|
+
delete landingModel.parts.desktop.windows
|
|
936
|
+
delete _.parts.desktop["task-bar"].tray
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (_.includeDesktop === "none" || (production && _.includeDesktop === "local-only")) {
|
|
940
|
+
removeDesktopFeatures()
|
|
941
|
+
delete _.parts.desktop["task-bar"]
|
|
942
|
+
delete landingModel.parts.desktop.taskBar
|
|
943
|
+
desktopFeatures--
|
|
944
|
+
} else if (_.includeDesktop === "menu-only" || (production && _.includeDesktop === "full")) {
|
|
945
|
+
removeDesktopFeatures()
|
|
946
|
+
delete _.parts.desktop["task-bar"].tray
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
if (!desktopFeatures) {
|
|
950
|
+
delete _.parts.desktop
|
|
951
|
+
delete landingModel.parts.desktop
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
_["landing-model.json"] = JSON.stringify(landingModel)
|
|
955
|
+
|
|
956
|
+
Object.defineProperties(_, {
|
|
957
|
+
landingModel: { value: landingModel },
|
|
958
|
+
preHydrationArchive: { value: serialize(_) }
|
|
959
|
+
})
|
|
894
960
|
}
|
|
895
961
|
|
|
962
|
+
configureArchiveContent()
|
|
896
963
|
hydratePartsRecursive(_)
|
|
897
964
|
hydrateSubjectOrigins()
|
|
898
965
|
countAndSortInheritorsRecursive(_.parts.abstract.part)
|
|
@@ -954,14 +1021,15 @@ function ƒ(_, compressedSubjectOrigins) {
|
|
|
954
1021
|
|
|
955
1022
|
logScope(1, "\nComputing Landing Hash & Route ID", hashLog => {
|
|
956
1023
|
|
|
957
|
-
const landingModel = JSON.parse(_["landing-model.json"])
|
|
958
|
-
const landingRouteID = _.modelToRouteID(landingModel)
|
|
959
|
-
const landingHash = encodeSegment(landingRouteID)
|
|
960
|
-
|
|
961
1024
|
_.define({
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1025
|
+
landingRouteID: {
|
|
1026
|
+
value: _.modelToRouteID(_.landingModel)
|
|
1027
|
+
},
|
|
1028
|
+
landingHash: {
|
|
1029
|
+
resolve() {
|
|
1030
|
+
return encodeSegment(this.landingRouteID)
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
965
1033
|
})
|
|
966
1034
|
|
|
967
1035
|
hashLog("Landing hash: " + _.landingHash)
|
|
@@ -982,12 +1050,20 @@ function ƒ(_, compressedSubjectOrigins) {
|
|
|
982
1050
|
}
|
|
983
1051
|
|
|
984
1052
|
ƒ({
|
|
1053
|
+
// TODO: fix source mapping bugs.
|
|
985
1054
|
verbosity: "1",
|
|
986
|
-
// TODO: Fix source mapping bugs.
|
|
987
|
-
mapping: "0",
|
|
988
1055
|
change: "major",
|
|
989
1056
|
hangHydration: "0",
|
|
990
|
-
haltHydration: "0",
|
|
991
1057
|
defaultApplicationHost: "kireji.app",
|
|
992
|
-
port: "3000"
|
|
1058
|
+
port: "3000",
|
|
1059
|
+
mapping: "disabled",
|
|
1060
|
+
resetLocalState: "enabled",
|
|
1061
|
+
haltHydration: "disabled",
|
|
1062
|
+
includeWarning: "enabled",
|
|
1063
|
+
includeColor: "full",
|
|
1064
|
+
includeEra: "full",
|
|
1065
|
+
includeMenuApps: "full",
|
|
1066
|
+
includeUpdates: "full",
|
|
1067
|
+
includeKirejiApp: "full",
|
|
1068
|
+
includeDesktop: "full"
|
|
993
1069
|
})
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "KirejiConfig",
|
|
4
|
+
"description": "Schema for the kireji.json configuration file.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"includeColor": {
|
|
8
|
+
"description": "Determines which color mode features will be included in the ecosystem.",
|
|
9
|
+
"oneOf": [
|
|
10
|
+
{
|
|
11
|
+
"const": "none",
|
|
12
|
+
"description": "The color component will never be included."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"const": "light",
|
|
16
|
+
"description": "Dark mode will never be included."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"const": "dark",
|
|
20
|
+
"description": "Light mode will never be included."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"const": "debug-dark",
|
|
24
|
+
"description": "Dark mode will only be included in local builds."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"const": "debug-light",
|
|
28
|
+
"description": "Light mode will only be included in local builds."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"const": "full",
|
|
32
|
+
"description": "The full color component will always be included."
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"includeEra": {
|
|
37
|
+
"description": "Determines which era mode features will be included in the ecosystem.",
|
|
38
|
+
"oneOf": [
|
|
39
|
+
{
|
|
40
|
+
"const": "none",
|
|
41
|
+
"description": "The era component will never be included."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"const": "vintage",
|
|
45
|
+
"description": "Modern mode will never be included."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"const": "modern",
|
|
49
|
+
"description": "Vintage mode will never be included."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"const": "debug-modern",
|
|
53
|
+
"description": "Modern mode will only be included in local builds."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"const": "debug-vintage",
|
|
57
|
+
"description": "Vintage mode will only be included in local builds."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"const": "full",
|
|
61
|
+
"description": "The full era component will always be included."
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"includeMenuApps": {
|
|
66
|
+
"description": "Determines whether a list of apps should be included in the menu.",
|
|
67
|
+
"oneOf": [
|
|
68
|
+
{
|
|
69
|
+
"const": "none",
|
|
70
|
+
"description": "Apps will never appear in the menu."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"const": "local-only",
|
|
74
|
+
"description": "Apps will only appear in the menu in local builds."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"const": "full",
|
|
78
|
+
"description": "Apps will always appear in the menu."
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"includeUpdates": {
|
|
83
|
+
"description": "Determines whether or not the version updating features should be included in the menu.",
|
|
84
|
+
"oneOf": [
|
|
85
|
+
{
|
|
86
|
+
"const": "none",
|
|
87
|
+
"description": "Update features will never appear in the menu."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"const": "local-only",
|
|
91
|
+
"description": "Update features will only appear in the menu in local builds."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"const": "full",
|
|
95
|
+
"description": "Update features will always appear in the menu."
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"includeKirejiApp": {
|
|
100
|
+
"description": "Determines whether or not the Kireji IDE should be included in the ecosystem.",
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"const": "none",
|
|
104
|
+
"description": "kireji.app will never be included."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"const": "full",
|
|
108
|
+
"description": "kireji.app will only be included in local builds."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"const": "demo",
|
|
112
|
+
"description": "kireji.app will always be included (used only for Demo App Ecosystem)."
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"includeDesktop": {
|
|
117
|
+
"description": "Determines whether or not the ecosystem should include desktop-like features.",
|
|
118
|
+
"oneOf": [
|
|
119
|
+
{
|
|
120
|
+
"const": "none",
|
|
121
|
+
"description": "The desktop experience will never be included."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"const": "menu-only",
|
|
125
|
+
"description": "Only the menu will be included, and it will always be included."
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"const": "local-only",
|
|
129
|
+
"description": "The full desktop experience will only be included in local builds."
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"const": "full",
|
|
133
|
+
"description": "The menu will always be included. The desktop experience will only be included in local builds."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"const": "demo",
|
|
137
|
+
"description": "The full desktop experience will always be included (used only for Demo App Ecosystem)."
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"change": {
|
|
142
|
+
"description": "Represents the severity of the API change for semantic versioning.",
|
|
143
|
+
"oneOf": [
|
|
144
|
+
{
|
|
145
|
+
"const": "major",
|
|
146
|
+
"description": "A breaking change which breaks existing hash assignments."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"const": "minor",
|
|
150
|
+
"description": "A non-breaking change which adds new hash assignments."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"const": "patch",
|
|
154
|
+
"description": "A non-breaking change which does not impact hash assignments at all."
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"verbosity": {
|
|
159
|
+
"description": "A number used to control the detail in logs. Only messages with a priority <= this number will be logged.",
|
|
160
|
+
"type": "string"
|
|
161
|
+
},
|
|
162
|
+
"defaultApplicationHost": {
|
|
163
|
+
"description": "The host of the desired default app. The server will redirect to this when testing locally.",
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"port": {
|
|
167
|
+
"description": "The internal port (typically 3000-4000) where the server will be hosted.",
|
|
168
|
+
"type": "string"
|
|
169
|
+
},
|
|
170
|
+
"mapping": {
|
|
171
|
+
"description": "Determines whether or not the artifact should be output with embedded source map data.",
|
|
172
|
+
"enum": [
|
|
173
|
+
"disabled",
|
|
174
|
+
"enabled"
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"haltHydration": {
|
|
178
|
+
"description": "If enabled, halts the hydration of the application completely. Useful for debugging FOUC.",
|
|
179
|
+
"enum": [
|
|
180
|
+
"disabled",
|
|
181
|
+
"enabled"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"includeWarning": {
|
|
185
|
+
"description": "If enabled, a warning line appears at the top of all applications regarding alpha status.",
|
|
186
|
+
"enum": [
|
|
187
|
+
"disabled",
|
|
188
|
+
"enabled"
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"resetLocalState": {
|
|
192
|
+
"description": "If enabled, applications running locally will reset to their landing hash when the service worker is replaced.",
|
|
193
|
+
"enum": [
|
|
194
|
+
"disabled",
|
|
195
|
+
"enabled"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"hangHydration": {
|
|
199
|
+
"description": "A string representing how long the main thread should hang to simulate loading. Useful for debugging FOUC.",
|
|
200
|
+
"type": "string"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": [],
|
|
204
|
+
"additionalProperties": false
|
|
205
|
+
}
|
package/src/part.css_.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const
|
|
2
|
+
includeWarning = _.includeWarning === "enabled",
|
|
3
|
+
includeDesktop = _.includeDesktop === "demo" || (!production && (_.includeDesktop === "full" || _.includeDesktop === "local-only"))
|
|
4
|
+
|
|
5
|
+
return /* css */`
|
|
6
|
+
|
|
7
|
+
html, body {
|
|
8
|
+
--warning-height: ${includeWarning ? "26px" : "0px"};
|
|
9
|
+
${includeDesktop ? "" : `--title-bar-height: 0px !important;
|
|
10
|
+
--task-bar-height: 0px !important;`}
|
|
11
|
+
}${includeWarning ? `
|
|
12
|
+
|
|
13
|
+
@media (width < 390px) {
|
|
14
|
+
|
|
15
|
+
html,
|
|
16
|
+
body {
|
|
17
|
+
--warning-height: 49px;
|
|
18
|
+
}
|
|
19
|
+
}` : ""}
|
|
20
|
+
` + _["static.css"]
|
package/src/part.html_.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
const
|
|
2
2
|
title = sanitizeAttr(application.title ?? "Untitled App"),
|
|
3
|
-
icon = application.placeholderImage("part.png")
|
|
3
|
+
icon = application.placeholderImage("part.png"),
|
|
4
|
+
classes = [...application.classes],
|
|
5
|
+
includeDesktop = _.includeDesktop === "demo" || (!production && (_.includeDesktop === "full" || _.includeDesktop === "local-only")),
|
|
6
|
+
includeMenu = includeDesktop || _.includeDesktop === "menu-only" || _.includeDesktop === "full"
|
|
7
|
+
|
|
8
|
+
if (_.includeEra !== "none")
|
|
9
|
+
classes.push(era.arm.key)
|
|
10
|
+
|
|
11
|
+
if (_.includeColor !== 'none')
|
|
12
|
+
classes.push(color.arm.key)
|
|
13
|
+
|
|
14
|
+
if (includeMenu)
|
|
15
|
+
classes.push(taskBar.menu.classes)
|
|
4
16
|
|
|
5
17
|
return _.injectImages(/* html */`<!DOCTYPE html>
|
|
6
18
|
<html lang=en>
|
|
@@ -15,25 +27,25 @@ return _.injectImages(/* html */`<!DOCTYPE html>
|
|
|
15
27
|
<link rel="canonical" href="https://${application.host}${application.canonicalPathname ?? "/"}" />
|
|
16
28
|
<!-- <link rel="manifest"${worker.manifestLink}/> -->
|
|
17
29
|
<style id="user-css">${_["part.css"]}</style>
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
${_.includeEra === "none" ? "" : /*html*/`<style id="era-css">${era["part.css"]}</style>`}
|
|
31
|
+
${_.includeColor === "none" ? "" : /*html*/`<style id="color-css">${color["part.css"]}</style>`}
|
|
20
32
|
<style id="application-css">${application["part.css"]}</style>
|
|
21
33
|
</head>
|
|
22
|
-
<body class="unhydrated ${
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
<body class="unhydrated ${classes.join(" ")}">
|
|
35
|
+
${_.includeWarning === "enabled" ? /*html*/`<warning->🚧 App in Alpha. Features subject to change/break without notice.</warning->` : ""}
|
|
36
|
+
${includeDesktop ? `<title-bar autofocus tabIndex=0>
|
|
25
37
|
<img class="part-icon" src="${icon}"/>
|
|
26
38
|
<span id=application-title>${title}</span>
|
|
27
39
|
<flex-spacer></flex-spacer>
|
|
28
40
|
<button class=hide ${windows.pointAttr("hidePoint")}></button>
|
|
29
41
|
<button class=restore ${windows.pointAttr("restorePoint")} disabled></button>
|
|
30
42
|
<button class=close ${windows.pointAttr("closePoint")}></button>
|
|
31
|
-
</title-bar
|
|
43
|
+
</title-bar>` : ""}
|
|
32
44
|
<wallpaper- class=app-container id=${application.host.replaceAll(".", "_")} tabIndex=0 ${application.attributes.join(" ")}>
|
|
33
45
|
${application["part.html"]}
|
|
34
46
|
</wallpaper->
|
|
35
47
|
<!-- windows -->
|
|
36
|
-
${taskBar["part.html"]}
|
|
48
|
+
${includeMenu ? taskBar["part.html"] : ""}
|
|
37
49
|
${worker["part.html"]}
|
|
38
50
|
</body>
|
|
39
51
|
</html>`)
|