kireji 0.7.3 → 0.8.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.
Files changed (55) hide show
  1. package/package.json +1 -1
  2. package/src/app/kireji/description +1 -1
  3. package/src/app/kireji/editor/sections/state-space/part.html_.js +5 -5
  4. package/src/app/kireji/editor/static.css +7 -0
  5. package/src/app/kireji/editor/tab-group/mathML-subpart.js +8 -0
  6. package/src/app/kireji/sidebar/static.css +51 -15
  7. package/src/app/kireji/static.css +0 -4
  8. package/src/app/kireji/tool-bar/part.css +1 -1
  9. package/src/build.js +2 -1
  10. package/src/part.css_.js +14 -0
  11. package/src/part.html_.js +1 -1
  12. package/src/parts/abstract/clip/mathML-subpart.js +4 -0
  13. package/src/parts/abstract/match/mathML-subpart.js +9 -0
  14. package/src/parts/abstract/mesh/data-get.js +11 -0
  15. package/src/parts/abstract/mesh/mathML-subpart.js +10 -0
  16. package/src/parts/abstract/mesh/ray-cast.js +4 -4
  17. package/src/parts/abstract/mesh/type.d.ts +10 -0
  18. package/src/parts/abstract/mix/mathML-subpart.js +9 -0
  19. package/src/parts/abstract/part/mathML-subpart.js +3 -0
  20. package/src/parts/abstract/part/mathML.js +22 -0
  21. package/src/parts/abstract/part/part.json +11 -0
  22. package/src/parts/abstract/part/type.d.ts +4 -0
  23. package/src/parts/abstract/part-mask/mathML-subpart.js +1 -0
  24. package/src/parts/abstract/part-outliner/itemHTML-recursive.js +1 -1
  25. package/src/parts/abstract/permutation/mathML-subpart.js +10 -0
  26. package/src/parts/abstract/scroller/mathML-subpart.js +1 -0
  27. package/src/parts/abstract/scroller/onscroll.js +3 -1
  28. package/src/parts/desktop/windows/superset-get.js +1 -1
  29. package/src/{part.css → static.css} +0 -10
  30. package/src/type.d.ts +1 -1
  31. package/src/app/kireji/editor/tab-group/equation.html_.js +0 -42
  32. package/src/parts/abstract/boolean/equation-variable.html +0 -1
  33. package/src/parts/abstract/box/build.js +0 -24
  34. package/src/parts/abstract/box/constants.js +0 -1
  35. package/src/parts/abstract/box/description-abstract +0 -1
  36. package/src/parts/abstract/box/dimensions_.js +0 -1
  37. package/src/parts/abstract/box/equation.html_.js +0 -1
  38. package/src/parts/abstract/box/model_.js +0 -1
  39. package/src/parts/abstract/box/part.json +0 -3
  40. package/src/parts/abstract/box/routeID-distribute.js +0 -7
  41. package/src/parts/abstract/box/routeID-model-to.js +0 -18
  42. package/src/parts/abstract/box/title-abstract +0 -1
  43. package/src/parts/abstract/box/type.d.ts +0 -20
  44. package/src/parts/abstract/match/equation.html_.js +0 -11
  45. package/src/parts/abstract/mix/equation.html_.js +0 -11
  46. package/src/parts/abstract/part/equation-variable.html_.js +0 -1
  47. package/src/parts/abstract/part/equation.html_.js +0 -3
  48. package/src/parts/abstract/part-mask/equation-variable.html_.js +0 -1
  49. package/src/parts/abstract/part-mask/equation.html_.js +0 -1
  50. package/src/parts/abstract/permutation/equation.html_.js +0 -1
  51. package/src/parts/abstract/scroller/equation-variable.html +0 -1
  52. package/src/parts/abstract/scroller/equation.html +0 -1
  53. package/src/parts/user/part.json +0 -3
  54. package/src/parts/user/title +0 -1
  55. package/src/parts/user/type.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kireji",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "description": "A web framework for stateful, entropy-perfect, multi-origin web applications. Currently in alpha. Expect breaking changes for version 0. Use with caution!",
5
5
  "files": [
6
6
  "src/",
@@ -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 in the ecosystem.
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
- `<p>${cardinalityAsString.length < 16 ? cardinalityAsString : scientific(activePartCardinality, true)}</p>` +
10
+ activePart.mathML(0, "value") +
8
11
  `<hr>` +
9
12
  "<h3>Hartley Entropy</h3>" +
10
- `<p>${toCharms(activePartCardinality)} (${toBits(activePartCardinality)})</p>` +
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 side-bar {
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
- border-right: 1px solid var(--bg-un-mode);
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
- margin-right: calc(var(--tab-line-height) / 2);
127
+ width: calc((var(--depth) - 1) * var(--tab-line-height) / 2);
128
+ margin-right: var(--tab-line-height);
111
129
  }
112
130
 
113
- #kireji_app details.empty>summary>outliner-spacer:last-of-type {
114
- border: none;
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 side-bar {
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 3px 0 0 -1px var(--accent);
30
+ box-shadow: inset -5px 0 0 -1px var(--accent);
31
31
  }
32
32
 
33
33
  body.vintage #kireji_app tool-bar {
package/src/build.js CHANGED
@@ -989,5 +989,6 @@ function ƒ(_, compressedSubjectOrigins) {
989
989
  hangHydration: "0",
990
990
  haltHydration: "0",
991
991
  defaultApplicationHost: "kireji.app",
992
- port: "3000"
992
+ port: "3000",
993
+ showWarning: "1"
993
994
  })
@@ -0,0 +1,14 @@
1
+ return /* css */`
2
+
3
+ html, body {
4
+ --warning-height: ${+_.showWarning ? "26px" : "0px"};
5
+ }${+_.showWarning ? `
6
+
7
+ @media (width < 390px) {
8
+
9
+ html,
10
+ body {
11
+ --warning-height: 49px;
12
+ }
13
+ }` : ""}
14
+ ` + _["static.css"]
package/src/part.html_.js CHANGED
@@ -20,7 +20,7 @@ return _.injectImages(/* html */`<!DOCTYPE html>
20
20
  <style id="application-css">${application["part.css"]}</style>
21
21
  </head>
22
22
  <body class="unhydrated ${[era.arm.key, color.arm.key, ...taskBar.menu.classes, ...application.classes].join(" ")}">
23
- <warning->🚧 App in Alpha. Features subject to change/break without notice.</warning->
23
+ ${+_.showWarning ? `<warning->🚧 App in Alpha. Features subject to change/break without notice.</warning->` : ""}
24
24
  <title-bar autofocus tabIndex=0>
25
25
  <img class="part-icon" src="${icon}"/>
26
26
  <span id=application-title>${title}</span>
@@ -0,0 +1,4 @@
1
+ if (DEPTH <= 0)
2
+ return [/* xml */`<mi>frames</mi><mo>(</mo><msub><mi>𝑝</mi><mi>${clip.key}</mi></msub><mo>)</mo>`]
3
+
4
+ return [`<mn>${clip.cardinality}</mn>`]
@@ -0,0 +1,9 @@
1
+ const defaultTerm = /* xml */`<mn>1</mn>`
2
+
3
+ if (DEPTH <= 0 || part.length === 0)
4
+ // Strip the "<math>" tags off.
5
+ return [match.length ? /* xml */`<mo largeop="true">∑</mo><msub><mi>𝑘</mi><msub><mi>𝑝</mi><mi>${part.key ?? "ecosystem"}</mi></msub></msub>` : defaultTerm]
6
+
7
+ const operator = "<mo>+</mo>"
8
+ const addends = part.map(addend => addend.mathML(DEPTH - 1, "none", LABELS, true, false))
9
+ return addends.length ? addends.flatMap(addend => [addend, operator]).slice(0, -1) : [defaultTerm]
@@ -0,0 +1,11 @@
1
+ const { points, tris } = mesh.manifest
2
+
3
+ const data = [[], []]
4
+
5
+ for (let index = 0; index < points.length; index += 2)
6
+ data[0].push([points[index], points[index + 1]])
7
+
8
+ for (let index = 0; index < tris.length; index += 3)
9
+ data[1].push([tris[index], tris[index + 1], tris[index + 2]])
10
+
11
+ return data
@@ -0,0 +1,10 @@
1
+ if (DEPTH <= 0)
2
+ return [
3
+ `<munder><mo>∑</mo><mrow><mi>t</mi><mo>∈</mo><mi>tris</mi><mo>(</mo><msub><mi>𝑝</mi><mi>${mesh.key}</mi></msub><mo>)</mo></mrow></munder>`,
4
+ `<munder><mo>∑</mo><mrow><mi>r</mi><mo>∈</mo><mi>rows</mi><mo>(</mo><mi>t</mi><mo>)</mo></mrow></munder>`,
5
+ `<msub><mi>𝑘</mi><mi>r</mi></msub>`
6
+ ]
7
+
8
+ return /*mesh.triTable.length > 20 ? base(DEPTH) :*/ mesh.triTable.flatMap(triData => {
9
+ return [`<mn>${triData.cardinality}</mn>`, "<mo>+</mo>"]
10
+ }).slice(0, -1)
@@ -20,7 +20,7 @@ const timeBetweenIntersections = { ...timeOfNextIntersection }
20
20
  // Set the clock to zero.
21
21
  let time = 0
22
22
 
23
- function initalizeRayIntersectionSchedule(alsoComputeIntersectionInterval) {
23
+ function initializeRayIntersectionSchedule(alsoComputeIntersectionInterval) {
24
24
 
25
25
  // If the force vector isn't parallel to the x axis...
26
26
  if (FORCE_VECTOR.x !== 0) {
@@ -45,7 +45,7 @@ function initalizeRayIntersectionSchedule(alsoComputeIntersectionInterval) {
45
45
  }
46
46
  }
47
47
 
48
- initalizeRayIntersectionSchedule(true)
48
+ initializeRayIntersectionSchedule(true)
49
49
 
50
50
  const start = _.now
51
51
 
@@ -160,7 +160,7 @@ while (true) {
160
160
  }
161
161
 
162
162
  if (boundaryAppearsFlat) {
163
- // TODO: Consider using the line through the opposing neighbors to search for assymetry in the mesh boundry.
163
+ // TODO: Consider using the line through the opposing neighbors to search for asymmetry in the mesh boundary.
164
164
  }
165
165
 
166
166
  // If there is no neighboring point, we are "stuck". The ray cast ends here.
@@ -232,7 +232,7 @@ while (true) {
232
232
  safeIterationResult.forceVector = FORCE_VECTOR
233
233
 
234
234
  // The normal ray intersection schedule has changed.
235
- initalizeRayIntersectionSchedule()
235
+ initializeRayIntersectionSchedule()
236
236
 
237
237
  // Proceed with normal ray casting behavior from this point.
238
238
  continue
@@ -26,6 +26,7 @@ declare interface IMesh<TOwner>
26
26
  readonly triIndex?: IMeshTriIndex
27
27
  /** The current position of the state in the mesh. */
28
28
  readonly position: IVector2
29
+ readonly manifest: IMeshManifest
29
30
  }
30
31
 
31
32
  declare interface IMeshTriData {
@@ -60,6 +61,15 @@ declare interface IMeshTriDataRow {
60
61
  readonly offset: bigint
61
62
  }
62
63
 
64
+
65
+ declare interface IMeshManifest
66
+ extends IPartManifest {
67
+ /** The available collision vertices as a flat array of 2D coordinates. Used for defining the world's collision tris. */
68
+ readonly points: number[],
69
+ /** The list of collision tris, as a flat array of point triples. Used to define the walkable area of the world. */
70
+ readonly tris: number[]
71
+ }
72
+
63
73
  declare type IMeshData = [IMeshPoint[], IMeshTri[]]
64
74
 
65
75
  declare type IMeshTri =
@@ -0,0 +1,9 @@
1
+ const defaultTerm = /* xml */`<mn>1</mn>`
2
+
3
+ if (DEPTH <= 0 || part.length === 0)
4
+ // Strip the "<math>" tags off.
5
+ return [mix.length ? /* xml */`<mo largeop="true">∏</mo><msub><mi>𝑘</mi><msub><mi>𝑝</mi><mi>${part.key ?? "ecosystem"}</mi></msub></msub>` : defaultTerm]
6
+
7
+ const operator = "<mo class=product>&sdot;</mo>"
8
+ const factors = part.map(subpart => subpart.mathML(DEPTH - 1, "none", LABELS, true, false)).filter(mathML => mathML !== defaultTerm && mathML !== `<mrow>${defaultTerm}</mrow>`)
9
+ return factors.length ? factors.flatMap(factor => [factor, operator]).slice(0, -1) : [defaultTerm]
@@ -0,0 +1,3 @@
1
+ const cardinality = part.cardinality
2
+ const cardinalityAsString = instances.includes(part) ? cardinality.toString() : null
3
+ return [cardinalityAsString.length < 16 ? `<mn>${cardinalityAsString}</mn>` : scientific(cardinality, true).slice(6, -7).split("<mo>&sdot;</mo>").flatMap(term => [term, "<mo>&sdot;</mo>"]).slice(0, -1)]
@@ -0,0 +1,22 @@
1
+ const equationVariable = EQUATION_TYPE === "variable" || EQUATION_TYPE === "both" ? `${recurse(0, "none", false, false)}<mo>=</mo>` : ""
2
+ const equationValue = EQUATION_TYPE === "value" || EQUATION_TYPE === "both" ? `<mo>=</mo>${part.cardinality.toString().length <= 15 ? `<mn>${part.cardinality}</mn>` : `<mrow>${scientific(part.cardinality, true).slice(6, -7)}</mrow>`}` : ""
3
+ const expression = (() => {
4
+
5
+ if (DEPTH <= 0)
6
+ return `<msub><mi>𝑘</mi><mi>${part.key ?? "ecosystem"}</mi></msub>`
7
+
8
+ const terms = part.subpartMathML(DEPTH - 1, LABELS)
9
+
10
+ const needsParentheses = PARENTHESIZE && terms.length > 1
11
+
12
+ debug(terms)
13
+
14
+ // Allow "<mrow>" tag nesting for parentheses.
15
+ return (LABELS ? "<munder>" + (needsParentheses ? "" : "<mrow>") : "") + (needsParentheses ? "<mrow class=parenthetic><mo>(</mo>" : "") + terms.join("") + (needsParentheses ? `<mo>)</mo></mrow>` : "") + (LABELS ? (needsParentheses ? "" : "</mrow>") + `<munder><mo stretchy="true">&#x23df;</mo>${recurse(0, "none", false, false)}</munder></munder>` : "")
16
+ })()
17
+
18
+ // TODO: handle parenthesis!
19
+
20
+ const showBracketBelow = DEPTH > 2
21
+
22
+ return /* html */`${WRAP_IN_MATH_TAG ? "<math displaystyle=true><mrow>" : ""}${equationVariable}${expression}${equationValue}${WRAP_IN_MATH_TAG ? "</mrow></math>" : ""}`
@@ -75,6 +75,17 @@
75
75
  ],
76
76
  "manifest-resolve-part-from": [
77
77
  "PROPERTY_KEY"
78
+ ],
79
+ "mathML": [
80
+ "DEPTH = 0",
81
+ "EQUATION_TYPE = \"none\"",
82
+ "LABELS = false",
83
+ "PARENTHESIZE = false",
84
+ "WRAP_IN_MATH_TAG = true"
85
+ ],
86
+ "mathML-subpart": [
87
+ "DEPTH",
88
+ "LABELS"
78
89
  ]
79
90
  }
80
91
  }
@@ -109,6 +109,10 @@ declare interface IPart<TOwner, TSubpart>
109
109
  readonly resolveOwnerOfManifest(PROPERTY_KEY: string): IPartAny | null
110
110
  /** Returns a part whose host was provided as a (potentially relative) host name using the given property key in the part's manifest. This method uses the nearest part on which the manifest key is actually defined as the base for resolving any relative host name. Returns null if the given property does not exist anywhere in the chain. */
111
111
  readonly resolvePartFromManifest(PROPERTY_KEY: string): IPartAny | null
112
+ /** Generates a returns a MathML string that depicts the cardinality equation of the platform. @param DEPTH the number of levels deep to expand the terms of the equation (up to Infinity) @param AS_EQUATION when true, begins the expression with something like `<math><msub><mi>k</mi><mi>part key</mi></msub><mo>=</mo>...` @param PARENTHESIZE whether or not to add parenthesis around the expression (useful when it will be nested in a larger one) (they will only be added if the resulting expression is not a single term). */
113
+ readonly mathML(DEPTH: number = 0, EQUATION_TYPE: string = "none", LABELS: boolean = false, PARENTHESIZE: boolean = false, WRAP_IN_MATH_TAG: boolean = true): string
114
+ /** Returns an array of string terms and operators which, when joined, depict the part's cardinality collecting arithmetic. */
115
+ readonly subpartMathML(DEPTH: number, LABELS: boolean): string[]
112
116
 
113
117
  // Runtime Properties.
114
118
  /** The parent part.
@@ -0,0 +1 @@
1
+ return [/* xml */`<msup><mn>2</mn><mn>${partMask.superset.length}</mn></msup>`]
@@ -6,7 +6,7 @@ return partOutliner.getChildren(SUBJECT).map((childPart, i, childArray) => {
6
6
  const symbol = `<img src="${childPart.placeholderImage("part.png")}"/>`
7
7
  const handle = hasSubparts ? `<svg ${partOutliner.pointAttr("togglePoint", folderIndex)} xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 2 2" class="explore-toggle"><line x1="-0.41" y1="0" x2="0.41" y2="0" stroke-width="0.2" stroke-linecap="round" />${isOpen ? "" : `<line x1="0" y1="-0.41" x2="0" y2="0.41" stroke-width="0.2" stroke-linecap="round" />`}</svg>` : ""
8
8
  const label = `<span class="label${childPart.isAbstract ? " abstract" : ""}">${partOutliner.getLabel(childPart)}</span>`
9
- const summary = `<summary ${partOutliner.pointAttr("point", partIndex)} data-index="${partIndex}"${partOutliner.isActive(childPart) ? " data-active" : ""}${IS_LAST_OF_TYPE && !hasSubparts ? ' id="lastOutlinerItem"' : ""}>${Array(DEPTH + +!hasSubparts).fill('<outliner-spacer></outliner-spacer>').join("")}${handle}${symbol}${label}</summary>`
9
+ const summary = `<summary ${partOutliner.pointAttr("point", partIndex)} data-index="${partIndex}"${partOutliner.isActive(childPart) ? " data-active" : ""}${IS_LAST_OF_TYPE && !hasSubparts ? ' id="lastOutlinerItem"' : ""}><outliner-spacer style="--depth:${DEPTH + +!hasSubparts}"></outliner-spacer>${handle}${symbol}${label}</summary>`
10
10
  return `<details${hasSubparts ? "" : ` class=empty`} ${isOpen ? "open" : ""}>${summary}${recurse(childPart, DEPTH + 1, IS_LAST_OF_TYPE && i === childArray.length - 1)}</details>`
11
11
  }).join("")
12
12
 
@@ -0,0 +1,10 @@
1
+ const n = permutation.supersetSize
2
+
3
+ // TODO: factor in other aspects when expanding to the collection type.
4
+
5
+ return [
6
+ "<mn>1</mn>",
7
+ "<mo>+</mo>",
8
+ `<munderover><mo>∑</mo><mrow><mi>𝑛</mi><mo>=</mo><mn>1</mn></mrow><mi>${n}</mi></munderover>`,
9
+ `<munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow><mi>𝑛</mi></mrow></munderover><mrow><mn>${permutation.payloadCardinality}</mn><mo>(</mo><mi>${n}</mi><mo>-</mo><mi>i</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>`
10
+ ]
@@ -0,0 +1 @@
1
+ return [`<msup><mn>10</mn><mn>4</mn></msup>`]
@@ -1,4 +1,6 @@
1
- if (scroller.skipRouteIDUpdate) {
1
+ if (scroller.skipRouteIDUpdate || !client.hydrated) {
2
+ if (!client.hydrated)
3
+ debug('onscroll from within the hydration phase')
2
4
  scroller.skipRouteIDUpdate = false
3
5
  } else {
4
6
  const maxY = scroller.container.scrollHeight
@@ -1 +1 @@
1
- return Object.values(_.applications)
1
+ return Object.values(_.applications).filter(application => application !== _.parts.desktop)
@@ -30,7 +30,6 @@ body {
30
30
  --system-ui-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Mono", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Consolas", "Courier New", monospace;
31
31
  --menu-tween: 0;
32
32
  --h: 100vh;
33
- --warning-height: 28px;
34
33
  --wallpaper-height: calc(var(--h) - var(--task-bar-height) - var(--warning-height) - var(--title-bar-height));
35
34
  --wallpaper-width: 100vw;
36
35
  --padding: calc(3.5 * var(--spacing));
@@ -292,15 +291,6 @@ body.dark warning- {
292
291
  background-color: #644c08;
293
292
  }
294
293
 
295
- @media (width < 390px) {
296
-
297
- html,
298
- body {
299
- --warning-height: 49px;
300
- }
301
- }
302
-
303
-
304
294
  #fullscreen-tray-item,
305
295
  #share-tray-item {
306
296
  display: none !important;
package/src/type.d.ts CHANGED
@@ -283,7 +283,7 @@ declare function hydratePartsRecursive(part: string | IPartAny, domains: string[
283
283
  declare function resolveRelativeHost(relativeHost: string, base: string | string[]): string
284
284
  /** The immutable list of runtime instances for the root space, in order of when the were reached during recursive part hydration. */
285
285
  declare const instances: IPartAny[]
286
- /** The immutable list of every part in the root space, in order of when the were reached during recursive part hydration. */
286
+ /** The immutable list of every part of the root space, in order of when the were reached during recursive part hydration. */
287
287
  declare const allParts: IPartAny[]
288
288
  /** The immutable list of every part host and filename combination, in order of when the were reached during recursive part hydration. */
289
289
  declare const allSubjects: [host: string, filename?: string]
@@ -1,42 +0,0 @@
1
- return `<math>
2
- <mn>1</mn>
3
- <mo>+</mo>
4
- <munderover>
5
- <mo>&#x2211;</mo>
6
- <mrow>
7
- <msub><mi>𝑛</mi><mi>tabs</mi></msub>
8
- <mo>=</mo>
9
- <mn>1</mn>
10
- </mrow>
11
- <mi>${allSubjects.length}</mi>
12
- </munderover>
13
- <mrow>
14
- <mo>(</mo>
15
- <msub><mi>𝑛</mi><mi>tabs</mi></msub>
16
- <mo>+</mo>
17
- <mn>1</mn>
18
- <mo>)</mo>
19
- <msub><mi>𝑛</mi><mi>tabs</mi></msub>
20
- <mo>&#x00D7;</mo>
21
- <munderover>
22
- <mo>&#x220F;</mo>
23
- <mrow>
24
- <mi>i</mi>
25
- <mo>=</mo>
26
- <mn>1</mn>
27
- </mrow>
28
- <mrow>
29
- <msub><mi>𝑛</mi><mi>tabs</mi></msub>
30
- </mrow>
31
- </munderover>
32
- <mrow>
33
- <mo>(</mo>
34
- <mi>${allSubjects.length}</mi>
35
- <mo>-</mo>
36
- <mi>i</mi>
37
- <mo>-</mo>
38
- <mn>1</mn>
39
- <mo>)</mo>
40
- </mrow>
41
- </mrow>
42
- </math>`
@@ -1 +0,0 @@
1
- <math><mi>𝑏</mi></math>
@@ -1,24 +0,0 @@
1
- const { dimensions } = box
2
-
3
- if (!Array.isArray(dimensions) || dimensions.some(member => typeof member !== "bigint" && isNaN(member)))
4
- throw `The "dimensions" property of a box must be an array whose members are numeric.`
5
-
6
- const placeValues = []
7
- const placeStates = []
8
- const placeLimits = []
9
-
10
- let product = 1n
11
-
12
- for (const dimension of dimensions) {
13
- placeValues.push(product)
14
- placeStates.push(-1)
15
- placeLimits.push(dimension)
16
- product *= BigInt(dimension)
17
- }
18
-
19
- box.define({
20
- cardinality: { value: product },
21
- placeValues: { value: placeValues },
22
- placeStates: { value: placeStates },
23
- placeLimits: { value: placeLimits }
24
- })
@@ -1 +0,0 @@
1
- const box = this
@@ -1 +0,0 @@
1
- This part provides a set of independent state variables just like the mix but the box keeps its factors self-contained instead of distributing them across subparts. The box is ideal for cartesian product spaces whose factors don't need to handle their own view updates or store any data beyond their cardinality.
@@ -1 +0,0 @@
1
- return []
@@ -1 +0,0 @@
1
- return `<math>${box.dimensions.map(dimension => `<mn>${dimension}</mn>`).join("<mo>&sdot;</mo>")}</math>`
@@ -1 +0,0 @@
1
- return [...box.placeStates]
@@ -1,3 +0,0 @@
1
- {
2
- "abstract": true
3
- }
@@ -1,7 +0,0 @@
1
- box.updateRouteID(ROUTE_ID)
2
-
3
- for (let i = box.placeValues.length - 1; i >= 0; i--) {
4
- const placeValue = box.placeValues[i]
5
- box.placeStates[i] = Number(ROUTE_ID / placeValue)
6
- ROUTE_ID %= placeValue
7
- }
@@ -1,18 +0,0 @@
1
- if (!Array.isArray(MODEL))
2
- throw new TypeError(`Model To RouteID Error: Box "${box.host}" does not support computing a route ID from a model of type "${typeof MODEL}".`)
3
-
4
- if (MODEL.length !== box.placeValues.length)
5
- throw new RangeError(`Model To RouteID Error: Box "${box.host}" does not support computing a route ID from an array with a different length than the number of dimensions the box has.`)
6
-
7
- if (MODEL.some(member => isNaN(member)))
8
- throw new RangeError(`Model To RouteID Error: Box "${box.host}" does not support computing a route ID from an array with element(s) which are not numeric.`)
9
-
10
- const resultRouteID = box.placeValues.reduce((resultRouteID, placeValue, i) => resultRouteID + BigInt(placeValue) * BigInt(Math.max(Math.min(Math.round(MODEL[i]), box.placeLimits[i] - 1), 0)), 0n)
11
-
12
- if (resultRouteID >= part.cardinality)
13
- throw new RangeError(`Model To RouteID Error: Part "${part.host}" returned a route ID that was too large (${resultRouteID}) (max ${part.cardinality}).`)
14
-
15
- if (resultRouteID < 0n)
16
- throw new RangeError(`Model To RouteID Error: Part "${part.host}" returned a negative route ID.`)
17
-
18
- return resultRouteID
@@ -1 +0,0 @@
1
- Box Prototype
@@ -1,20 +0,0 @@
1
- declare interface IBox<TOwner>
2
- extends IPart<TOwner, null> {
3
-
4
- // Serialized Properties.
5
- readonly "dimensions": [number]
6
- // Runtime Properties.
7
- /** The array of dimension multipliers, (the value of a unit for each of the defined dimensions) where the box is viewed as a fixed-length mixed-radix string.
8
- *
9
- * Used to speed up computation. */
10
- readonly placeValues: bigint[]
11
- /** A cache of the individual dimension values as extracted from the box's overall route ID. */
12
- readonly placeStates: number[]
13
- /** A cache of the "dimensions" property, so that the array is not duplicated during arithmetic and so that the values are guaranteed to be bigints. */
14
- readonly placeLimits: number[]
15
- }
16
-
17
- declare type IBoxAny =
18
- IBox<IPartAny>
19
-
20
- declare const box: IBoxAny
@@ -1,11 +0,0 @@
1
- return "<math>" + (
2
- match.length ? (
3
- match.length > 4 ? (
4
- `<mo>∑</mo><msub><mi>𝑘</mi><mi>𝑝</mi></msub><mtext>,</mtext><mspace width="0.5em"/><mi>𝑝</mi><mo>∈</mo><mi>subparts</mi><mo>(</mo><msub><mi>P</mi><mi>${part.key ?? "ecosystem"}</mi></msub><mo>)</mo>`
5
- ) : (
6
- match.map(arm => arm["equation-variable.html"]).join("<mo>+</mo>")
7
- )
8
- ) : (
9
- "<mn>1</mn>"
10
- )
11
- ) + "</math>"
@@ -1,11 +0,0 @@
1
- return "<math>" + (
2
- mix.length ? (
3
- mix.length > 4 ? (
4
- `<mo>∏</mo><msub><mi>𝑘</mi><mi>𝑝</mi></msub><mtext>,</mtext><mspace width="0.5em"/><mi>𝑝</mi><mo>∈</mo><mi>subparts</mi><mo>(</mo><msub><mi>P</mi><mi>${part.key ?? "ecosystem"}</mi></msub><mo>)</mo>`
5
- ) : (
6
- mix.map(factor => factor["equation-variable.html"]).join("<mo>&sdot;</mo>")
7
- )
8
- ) : (
9
- "<mn>1</mn>"
10
- )
11
- ) + "</math>"
@@ -1 +0,0 @@
1
- return `<math><msub><mi>𝑘</mi><mi>${part.key ?? "ecosystem"}</mi></msub></math>`
@@ -1,3 +0,0 @@
1
- const cardinality = part.cardinality
2
- const cardinalityAsString = instances.includes(part) ? cardinality.toString() : null
3
- return cardinalityAsString.length < 16 ? `<math><mn>${cardinalityAsString}</mn></math>` : scientific(cardinality, true)
@@ -1 +0,0 @@
1
- return `<math><msup><mn>2</mn><mn>${partMask.superset.length}</mn></msup></math>`
@@ -1 +0,0 @@
1
- return `<math>${partMask["equation-variable.html"]}</math>`
@@ -1 +0,0 @@
1
- return `<math><mtext>TBD for ${permutation.maxInstanceCount} max instances.</mtext></math>`
@@ -1 +0,0 @@
1
- <math><mi>𝑠</mi></math>
@@ -1 +0,0 @@
1
- <math><msup><mn>10</mn><mn>4</mn></msup></math>
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "coming-soon"
3
- }
@@ -1 +0,0 @@
1
- User Parts
@@ -1,2 +0,0 @@
1
- declare type IUser
2
- = IErrorApplication<IParts>