@nebularstreams/statify 3.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.
Files changed (193) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/website.simple/webfonts/fa-brands-400.woff2 +0 -0
  3. package/dist/website.simple/webfonts/fa-solid-900.eot +0 -0
  4. package/dist/website.simple/webfonts/fa-solid-900.svg +4649 -0
  5. package/dist/website.simple/webfonts/fa-solid-900.ttf +0 -0
  6. package/dist/website.simple/webfonts/fa-solid-900.woff +0 -0
  7. package/dist/website.simple/webfonts/fa-solid-900.woff2 +0 -0
  8. package/dist/website.simple/website.css +32 -0
  9. package/dist/website.simple/website.min.js +6 -0
  10. package/dist/website.software/webfonts/fa-brands-400.woff2 +0 -0
  11. package/dist/website.software/webfonts/fa-solid-900.eot +0 -0
  12. package/dist/website.software/webfonts/fa-solid-900.svg +4649 -0
  13. package/dist/website.software/webfonts/fa-solid-900.ttf +0 -0
  14. package/dist/website.software/webfonts/fa-solid-900.woff +0 -0
  15. package/dist/website.software/webfonts/fa-solid-900.woff2 +0 -0
  16. package/dist/website.software/website.css +32 -0
  17. package/dist/website.software/website.min.js +6 -0
  18. package/dist/website.worlds/webfonts/fa-brands-400.woff2 +0 -0
  19. package/dist/website.worlds/webfonts/fa-solid-900.eot +0 -0
  20. package/dist/website.worlds/webfonts/fa-solid-900.svg +4649 -0
  21. package/dist/website.worlds/webfonts/fa-solid-900.ttf +0 -0
  22. package/dist/website.worlds/webfonts/fa-solid-900.woff +0 -0
  23. package/dist/website.worlds/webfonts/fa-solid-900.woff2 +0 -0
  24. package/dist/website.worlds/website.css +32 -0
  25. package/dist/website.worlds/website.min.js +6 -0
  26. package/package.json +49 -0
  27. package/readme.md +105 -0
  28. package/src/publisher-lib.js +179 -0
  29. package/src/publisher-list.js +91 -0
  30. package/src/publisher.js +38 -0
  31. package/src/util/cdn/nobj.cdn.js +88 -0
  32. package/src/util/htmlroute.js +39 -0
  33. package/src/util/markdown/lib.showdown.icon.js +62 -0
  34. package/src/util/markdown/lib.showdown.yt.js +54 -0
  35. package/src/util/markdown/markdown.js +144 -0
  36. package/src/util/navibar/util.navibar.js +63 -0
  37. package/src/util/sha.js +20 -0
  38. package/src/util/tokenizer.js +234 -0
  39. package/src/util/widgets/NoticeWidget.js +30 -0
  40. package/src/util/widgets/app.widgets.js +70 -0
  41. package/src/util/widgets/util.definewidget.js +14 -0
  42. package/src/widgets/Cookies.js +55 -0
  43. package/src/widgets/Frameset-simple.js +114 -0
  44. package/src/widgets/Frameset.js +124 -0
  45. package/src/widgets/Page.js +356 -0
  46. package/src/widgets/RightSide.js +93 -0
  47. package/src/widgets/Snippets.js +75 -0
  48. package/src/widgets/Tail.js +11 -0
  49. package/src/widgets/Widgets.js +10 -0
  50. package/src/widgets.client/Client.js +22 -0
  51. package/src/widgets.features/FeatureList.js +364 -0
  52. package/src/widgets.features/Youtube.js +23 -0
  53. package/src/widgets.features/bootcol.js +29 -0
  54. package/src/widgets.features/css/feature.css +112 -0
  55. package/src/widgets.features/css/tail.css +4 -0
  56. package/src/widgets.howto/Faq.js +201 -0
  57. package/src/widgets.howto/HowTo.js +419 -0
  58. package/src/widgets.howto/Tiles.js +51 -0
  59. package/src/widgets.howto/script-contractable.js +31 -0
  60. package/src/widgets.markdown/Document.js +84 -0
  61. package/src/widgets.market/MarketItem.js +278 -0
  62. package/src/widgets.market/MarketItem.orig.js +268 -0
  63. package/src/widgets.market/MarketItem.strips.js +276 -0
  64. package/src/widgets.market/StoryLicenseWIdget.js +45 -0
  65. package/src/widgets.market/app.utils.js +238 -0
  66. package/src.website/css/app/animations.css +27 -0
  67. package/src.website/css/app/ismobile.css +7 -0
  68. package/src.website/css/app/style.css +51 -0
  69. package/src.website/css/app/style.fullheight.css +9 -0
  70. package/src.website/css/app/style.mdblocks.css +59 -0
  71. package/src.website/css/app/style.putosafari.css +3 -0
  72. package/src.website/css/bootstrap/bootstrap-tiny-core.css +47 -0
  73. package/src.website/css/bootstrap/bootstrap-tiny-media-columns.css +1276 -0
  74. package/src.website/css/bootstrap/bootstrap-tiny-media-custom.css +59 -0
  75. package/src.website/css/bootstrap/bootstrap-tiny-media-display.css +279 -0
  76. package/src.website/css/bootstrap/bootstrap-tiny-media-flex.css +881 -0
  77. package/src.website/css/bootstrap/bootstrap-tiny-media-fonts.css +39 -0
  78. package/src.website/css/bootstrap/bootstrap-tiny-media-paddings.css +1348 -0
  79. package/src.website/css/css-core/core.ext.css +65 -0
  80. package/src.website/css/css-core/frontpage.css +28 -0
  81. package/src.website/css/css-core/root.css +34 -0
  82. package/src.website/css/css-core/root.fullheight.css +12 -0
  83. package/src.website/css/css-core/ui.dialog.round.css +14 -0
  84. package/src.website/css/css-core/ui.navibar.css +28 -0
  85. package/src.website/css/css-core/ui.notifications.css +12 -0
  86. package/src.website/css/css-featurelist/feature.css +196 -0
  87. package/src.website/css/css-featurelist/tail.css +4 -0
  88. package/src.website/css/css-screens/doc.css +22 -0
  89. package/src.website/css/css-screens/screens-meta.css +3 -0
  90. package/src.website/css/css-unsplash/unsplash.css +32 -0
  91. package/src.website/css/css-videos/youtube.css +28 -0
  92. package/src.website/css/css-wiki/wiki.css +206 -0
  93. package/src.website/css/css-wiki/wiki.sidepane.css +16 -0
  94. package/src.website/css/fontawesome/fa-brands.css +18 -0
  95. package/src.website/css/fontawesome/fa-solid.css +16 -0
  96. package/src.website/css/fontawesome/fa.css +4359 -0
  97. package/src.website/css/skin/mierda.css +15 -0
  98. package/src.website/css/skin/skin.dark.css +85 -0
  99. package/src.website/css/skin/skin.light.css +27 -0
  100. package/src.website/css/skin/vars.font.css +8 -0
  101. package/src.website/css/skin/vars.sizes.css +4 -0
  102. package/src.website/package-lock.json +2160 -0
  103. package/src.website/package.json +28 -0
  104. package/src.website/public/webfonts/fa-brands-400.woff2 +0 -0
  105. package/src.website/public/webfonts/fa-solid-900.eot +0 -0
  106. package/src.website/public/webfonts/fa-solid-900.svg +4649 -0
  107. package/src.website/public/webfonts/fa-solid-900.ttf +0 -0
  108. package/src.website/public/webfonts/fa-solid-900.woff +0 -0
  109. package/src.website/public/webfonts/fa-solid-900.woff2 +0 -0
  110. package/src.website/rollup.simple.mjs +36 -0
  111. package/src.website/rollup.software.mjs +36 -0
  112. package/src.website/rollup.terser.mjs +24 -0
  113. package/src.website/rollup.worlds.mjs +36 -0
  114. package/src.website/src/app/app.style.mjs +36 -0
  115. package/src.website/src/app/index.mjs +118 -0
  116. package/src.website/src/config.js +8 -0
  117. package/src.website/src/core/cdnmodel.mjs +7 -0
  118. package/src.website/src/core/clientruntime.mjs +41 -0
  119. package/src.website/src/core.cookies/analytics.mjs +96 -0
  120. package/src.website/src/core.cookies/cookiemanager.mjs +128 -0
  121. package/src.website/src/core.cookies/css/cookies.css +80 -0
  122. package/src.website/src/core.cookies/css/nocookies.css +48 -0
  123. package/src.website/src/core.extra/css/contractable.css +12 -0
  124. package/src.website/src/core.extra/css/faq.css +42 -0
  125. package/src.website/src/core.extra/css/howto.css +81 -0
  126. package/src.website/src/core.extra/extra.document.mjs +83 -0
  127. package/src.website/src/core.extra/extra.faq.mjs +30 -0
  128. package/src.website/src/core.extra/extra.mjs +62 -0
  129. package/src.website/src/main.simple.mjs +4 -0
  130. package/src.website/src/main.software.mjs +10 -0
  131. package/src.website/src/main.worlds.mjs +9 -0
  132. package/src.website/src/support/ismobile.mjs +4 -0
  133. package/src.website/src/support/nonce.mjs +4 -0
  134. package/src.website/src/support/persistsettings.mjs +41 -0
  135. package/src.website/src/support/qrcode.mjs +1269 -0
  136. package/src.website/src/support/timeutils.mjs +237 -0
  137. package/src.website/src/widgets/index.mjs +22 -0
  138. package/src.website/src.widgets/widgets.market/index.mjs +11 -0
  139. package/src.website/src.widgets/widgets.market/widgets/market/DiscoverWidget.mjs +401 -0
  140. package/src.website/src.widgets/widgets.market/widgets/market/EmptyNew.mjs +28 -0
  141. package/src.website/src.widgets/widgets.market/widgets/market/MarketDetail.mjs +78 -0
  142. package/src.website/src.widgets/widgets.market/widgets/market/MarketItem.mjs +349 -0
  143. package/src.website/src.widgets/widgets.market/widgets/market/MarketWidget.mjs +437 -0
  144. package/src.website/src.widgets/widgets.market/widgets/market/StoryLicenseWidget.mjs +34 -0
  145. package/src.website/src.widgets/widgets.market/widgets/market/css/market.css +394 -0
  146. package/src.website/src.widgets/widgets.market/widgets/market/css/notice.css +6 -0
  147. package/src.website/src.widgets/widgets.market/widgets/navibar/NaviBarWidget.mjs +58 -0
  148. package/src.website/src.widgets/widgets.market/widgets/navibar/css/titlebar.css +68 -0
  149. package/src.website/src.widgets/widgets.market/widgets/navibar/css/ui.navibar.css +28 -0
  150. package/src.website/src.widgets/widgets.software/index.mjs +9 -0
  151. package/src.website/src.widgets/widgets.software/widgets/BootStrapColumnWidget.mjs +17 -0
  152. package/src.website/src.widgets/widgets.software/widgets/DownloadWidget.mjs +210 -0
  153. package/src.website/src.widgets/widgets.software/widgets/LicenseWidget.js +103 -0
  154. package/src.website/src.widgets/widgets.software/widgets/css/download/download.css +110 -0
  155. package/src.website/src.widgets/widgets.software/widgets/css/license/beta.css +28 -0
  156. package/src.website/src.widgets/widgets.software/widgets/css/license/button.css +30 -0
  157. package/src.website/src.widgets/widgets.software/widgets/css/license/front.css +46 -0
  158. package/src.website/src.widgets/widgets.software/widgets/css/license/licenses.css +13 -0
  159. package/src.website/src.widgets/widgets.software/widgets/css/license/overstate.css +15 -0
  160. package/src.website/src.widgets/widgets.software/widgets/css/license/story.css +8 -0
  161. package/src.website/src.widgets/widgets.software/widgets/css/license/toolbar.css +9 -0
  162. package/src.website/src.widgets/widgets.software/widgets/support/version.mjs +88 -0
  163. package/src.website/src.widgets/widgets.worlds/index.mjs +11 -0
  164. package/src.website/src.widgets/widgets.worlds/widgets/LocalBrowser.mjs +386 -0
  165. package/src.website/src.widgets/widgets.worlds/widgets/LocalLauncher.code.mjs +247 -0
  166. package/src.website/src.widgets/widgets.worlds/widgets/LocalLauncher.mjs +239 -0
  167. package/src.website/src.widgets/widgets.worlds/widgets/css/input.css +32 -0
  168. package/src.website/src.widgets/widgets.worlds/widgets/css/localprojects.css +188 -0
  169. package/templates/documentation/assets/docs.css +7 -0
  170. package/templates/documentation/assets/images/right.webp +0 -0
  171. package/templates/documentation/images.json +12 -0
  172. package/templates/documentation/metadata.json +120 -0
  173. package/templates/documentation/pages/cookies.md +25 -0
  174. package/templates/documentation/pages/index.md +13 -0
  175. package/templates/documentation/pages/privacy.md +50 -0
  176. package/templates/documentation/pages/tos.md +49 -0
  177. package/templates/landing/assets/res/carousel/image-1.webp +0 -0
  178. package/templates/landing/assets/res/carousel/image-2.webp +0 -0
  179. package/templates/landing/assets/res/carousel/image-3.webp +0 -0
  180. package/templates/landing/assets/res/custom.css +122 -0
  181. package/templates/landing/assets/res/logos/favicon.ico +0 -0
  182. package/templates/landing/assets/res/logos/favicon.png +0 -0
  183. package/templates/landing/assets/res/logos/logo.medallion.png +0 -0
  184. package/templates/landing/assets/res/logos/logo.white.png +0 -0
  185. package/templates/landing/assets/res/proj/banda-tech-client.webp +0 -0
  186. package/templates/landing/assets/res/proj/banda-tech-server.webp +0 -0
  187. package/templates/landing/assets/res/proj/proj-common-ground.webp +0 -0
  188. package/templates/landing/assets/res/proj/proj-fieldnote.webp +0 -0
  189. package/templates/landing/assets/res/proj/proj-tribes.webp +0 -0
  190. package/templates/landing/images.json +932 -0
  191. package/templates/landing/metadata.json +115 -0
  192. package/templates/landing/pages/index.json +268 -0
  193. package/tool/cli.js +183 -0
@@ -0,0 +1,201 @@
1
+ const
2
+ m = require("mithril"),
3
+ defineWidget = require("../util/widgets/util.definewidget"),
4
+ { Icon } = require("../util/widgets/app.widgets"),
5
+ TailWidget = require("../widgets/Tail"),
6
+
7
+ BootCol = require("../widgets.features/bootcol"),
8
+ { createHtml } = require("../widgets/Snippets"),
9
+ { ItemTile } = require("./Tiles"),
10
+
11
+ { convert } = require("../util/markdown/markdown"),
12
+ { absoRoute } = require("../util/htmlroute"),
13
+
14
+ RightSide = require("../widgets/RightSide");
15
+
16
+ const
17
+ makeFaq = ({ title, description, faq }, metadata, relativeRoute) => ({
18
+ "@context": "https://schema.org",
19
+ "@type": "FAQPage",
20
+ name: title,
21
+ description,
22
+ lastReviewed: new Date().toISOString(),
23
+ mainEntity: faq.mainEntity.map((ent, i) => ({
24
+ "@type": "Question",
25
+ name: ent.name,
26
+ url: absoRoute("", metadata, relativeRoute) + "#question-" + (i + 1),
27
+ acceptedAnswer: {
28
+ "@type": "Answer",
29
+ text: convert(ent.acceptedAnswer, { metadata, relativeRoute }).html
30
+ }
31
+ })),
32
+ ...faq.author && {
33
+ author: [
34
+ {
35
+ "@type": "Person",
36
+ ...faq.author
37
+ }
38
+ ]
39
+ },
40
+ ...faq.publisher && {
41
+ publisher: {
42
+ "@type": "Person",
43
+ ...faq.publisher
44
+ }
45
+ }
46
+ }),
47
+
48
+ FaqQuestion = defineWidget(
49
+ ({ attrs }) => m(
50
+ BootCol,
51
+ {
52
+ htmlid: "question-" + attrs.index,
53
+ rows: true,
54
+ el: "li",
55
+ class: "pad-1 col-12 grows contractable question contracted",
56
+ subclass: "feature text-al-center shadow-2",
57
+ label: attrs.label
58
+ },
59
+ [
60
+ m(".flexrow.titquestion.col-12", [
61
+ m(".index", String(attrs.index)),
62
+ m("h3.marg-2.grows", { class: "qtitle", "data-index": attrs.index }, m.trust(attrs.name)),
63
+ m(Icon, {
64
+ iconClass: "fa-3x d-none d-sm-flex",
65
+ icon: "question-circle",
66
+ size: 3
67
+ })
68
+ ]),
69
+
70
+ m(".body.relative.marg-1.col-12.markdown.no-marg-bottom", m.trust(convert(attrs.acceptedAnswer, {
71
+ metadata: attrs.metadata,
72
+ relativeRoute: attrs.relativeRoute
73
+ }).html))
74
+ ]
75
+ )
76
+ ),
77
+
78
+ FaqWidget = defineWidget(
79
+ ({ attrs }) => {
80
+
81
+ const
82
+ { pageMetadata, metadata, relativeRoute, cdnModel, source } = attrs,
83
+ { faq, title, description } = pageMetadata,
84
+ parsedFaq = makeFaq(pageMetadata, metadata, relativeRoute);
85
+
86
+ return m(".flexrow.w-100.h-100", [
87
+ m.trust(createHtml(parsedFaq)),
88
+
89
+ m(
90
+ "ul.flexrow.h-100.w-100.wrap.scrolly.screen.fixboot.faq",
91
+ {
92
+ class: pageMetadata.class,
93
+ "aria-label": title
94
+ },
95
+ [
96
+ m(
97
+ BootCol,
98
+ {
99
+ el: "li",
100
+ label: title,
101
+ class: "pad-1 lighter col-12 screen",
102
+ subclass: "feature text-al-center shadow-2 pad-3"
103
+ },
104
+ [
105
+ m(ItemTile, {
106
+ class: "flexrow wrap ohidden",
107
+ items: [
108
+
109
+ {
110
+ class: "col-12 pad-6",
111
+ el: "h1",
112
+ text: title
113
+ },
114
+
115
+ ...description ? [
116
+ {
117
+ class: "marg-3 col-12",
118
+ text: description
119
+ }] : []
120
+ ]
121
+ })
122
+ ]
123
+ ),
124
+
125
+ ...faq.mainEntity
126
+ ? [
127
+ m("ol.pad-0.marg-0.col-12", { "aria-label": "List Of Questions" }, [
128
+ faq.mainEntity.map((step, idx) => m(
129
+ FaqQuestion,
130
+ {
131
+ ...step,
132
+ size: 3,
133
+ class: "pad-2 screen",
134
+ index: idx + 1,
135
+ metadata,
136
+ relativeRoute,
137
+ label: "Question Number " + (idx + 1)
138
+ },
139
+ []
140
+ ))
141
+ ])]
142
+ : [],
143
+
144
+ ...faq.publisher || faq.author
145
+ ? [
146
+ m(
147
+ BootCol,
148
+ {
149
+ el: "li",
150
+ class: "pad-1 lighter col-12 screen",
151
+ subclass: "feature text-al-center pad-6 shadow-2",
152
+ label: "publisher and author"
153
+ },
154
+ [
155
+ m(ItemTile, {
156
+ class: "flexrow wrap ohidden",
157
+ items: [
158
+ ...faq.publisher.name ? [
159
+ {
160
+ el: "h5",
161
+ class: "col-5 grows",
162
+ text: "published by " + faq.publisher.name
163
+ }
164
+ ] : [],
165
+ ...faq.author.name ? [
166
+ {
167
+ el: "h5",
168
+ class: "col-5 grows",
169
+ text: "written by " + faq.author.name
170
+ }
171
+ ] : []
172
+
173
+ ]
174
+ })
175
+ ]
176
+ )
177
+ ] : [],
178
+
179
+ ...pageMetadata.footer
180
+ ? [
181
+ m(
182
+ "li",
183
+ { "aria-label": pageMetadata.footer.title || "footer", class: "col-12" },
184
+ m(TailWidget, { li: true, class: "shadow-2", ...pageMetadata.footer })
185
+ )
186
+ ]
187
+ : []
188
+ ]
189
+ ),
190
+ m(RightSide, {
191
+ cdnModel,
192
+ source,
193
+ class: "grows d-none d-xl-flex",
194
+ ncsdom: metadata.site.domain
195
+ })
196
+ // m("script", FaqScript("question"))
197
+ ]);
198
+ }
199
+ );
200
+
201
+ module.exports = FaqWidget;
@@ -0,0 +1,419 @@
1
+ const
2
+ m = require("mithril"),
3
+ defineWidget = require("../util/widgets/util.definewidget"),
4
+ { Icon } = require("../util/widgets/app.widgets"),
5
+ TailWidget = require("../widgets/Tail"),
6
+
7
+ BootCol = require("../widgets.features/bootcol"),
8
+ { getYouTubeImage } = require("../widgets.features/Youtube"),
9
+ { createHtml } = require("../widgets/Snippets"),
10
+ { convert } = require("../util/markdown/markdown"),
11
+
12
+ ICONS = {
13
+ USD: "dollar-sign",
14
+ EUR: "euro-sign",
15
+ YEN: "yen-sign",
16
+ GBP: "pound-sign",
17
+ HowToTip: "info",
18
+ HowToDirection: "circle",
19
+ supply: "plus",
20
+ tool: "tools"
21
+ },
22
+ DEFAULT_ICON = "clock",
23
+ { ItemTile } = require("./Tiles"),
24
+ { parseImage, absoRoute } = require("../util/htmlroute"),
25
+
26
+ makeImageOrVideo = (source, metadata, relativeRoute) => ({
27
+ ...source.image && {
28
+ image: parseImage(source.image, metadata, relativeRoute)
29
+ },
30
+ ...source.youtube && {
31
+ video: {
32
+ "@type": "VideoObject",
33
+ name: source.youtube.name,
34
+ description: source.youtube.description,
35
+ thumbnailUrl: getYouTubeImage(source.youtube.ref),
36
+ contentUrl: "https://www.youtube.com/watch?v=" + source.youtube.ref,
37
+ embedUrl: "https://www.youtube.com/embed/" + source.youtube.ref,
38
+ uploadDate: new Date().toISOString()
39
+ }
40
+ }
41
+ }),
42
+ { YouTube } = require("../widgets.features/Youtube"),
43
+
44
+ RightSide = require("../widgets/RightSide");
45
+
46
+ const
47
+
48
+ makeHowto = ({ title, image, howto }, metadata, relativeRoute) => ({
49
+ "@context": "https://schema.org",
50
+ "@type": "HowTo",
51
+
52
+ name: title,
53
+
54
+ ...makeImageOrVideo({ image }, metadata, relativeRoute),
55
+ ...makeImageOrVideo(howto, metadata, relativeRoute),
56
+
57
+ supply: howto.supply.map((supply) => ({
58
+ "@type": "HowToSupply",
59
+ name: supply
60
+ })),
61
+
62
+ tool: howto.tool.map((tool) => ({
63
+ "@type": "HowToTool",
64
+ name: tool
65
+ })),
66
+ step: howto.step.map(
67
+ (step, i) => ({
68
+ "@type": "HowToStep",
69
+ url: absoRoute("", metadata, relativeRoute) + "#step-" + String(i + 1),
70
+ name: step.name,
71
+ itemListElement: step.itemListElement.map((idx) => (
72
+ {
73
+ text: typeof idx === "string" ? idx : idx[0],
74
+ "@type": typeof idx === "string" || !idx[1] ? "HowToDirection" : idx[1]
75
+ })),
76
+ image: parseImage(step.image, metadata, relativeRoute)
77
+ })
78
+ ),
79
+ ...howto.estimatedCost && {
80
+ estimatedCost: {
81
+ "@type": "MonetaryAmount",
82
+ ...howto.estimatedCost
83
+ }
84
+ },
85
+ ...howto.totalTime && {
86
+ totalTime: howto.totalTime
87
+ },
88
+ ...howto.author && {
89
+ author: [
90
+ {
91
+ "@type": "Person",
92
+ ...howto.author
93
+ }
94
+ ]
95
+ },
96
+ ...howto.publisher && {
97
+ publisher: {
98
+ "@type": "Person",
99
+ ...howto.publisher
100
+ }
101
+ }
102
+ }),
103
+
104
+ HowToStep = defineWidget(
105
+ ({ attrs }) => m(
106
+ BootCol,
107
+ {
108
+ htmlid: "step-" + attrs.index,
109
+ rows: true,
110
+ el: "li",
111
+ class: "pad-1 col-12 grows",
112
+ subclass: "feature contractable text-al-center shadow-2 contracted",
113
+ label: attrs.title
114
+ },
115
+ [
116
+ m(".flexrow.titquestion.col-12", [
117
+ m(".index", String(attrs.index)),
118
+ m("h3.marg-2.grows", { "data-index": String(attrs.index) }, attrs.name),
119
+ m(Icon, {
120
+ iconClass: "d-none d-sm-flex",
121
+ icon: attrs.icon || "angle-double-down",
122
+ size: 2
123
+ })
124
+ ]),
125
+ m(".body.col-12.flexrow.wrap", [
126
+
127
+ ...attrs.description
128
+ ? [
129
+ m(
130
+ ".description.col-12",
131
+ m.trust(convert(attrs.description, { metadata: attrs.metadata, relativeRoute: attrs.relativeRoute }).html)
132
+ )
133
+ ]
134
+ : [],
135
+
136
+ attrs.image
137
+ ? [
138
+ m(".imgstep.col-12.col-lg-6.relative", [
139
+ m(
140
+ "img.w-100",
141
+ {
142
+ src: attrs.image.url,
143
+ alt: attrs.image.alt,
144
+ title: attrs.image.alt
145
+ }
146
+ )
147
+ ])
148
+ ]
149
+ : [],
150
+
151
+ m(
152
+ "ul.howtolist.instructions.col-12.col-lg-6",
153
+ attrs.itemListElement.map(
154
+ (il) => {
155
+
156
+ const clase = (typeof il === "string" || !il[1])
157
+ ? "HowToDirection"
158
+ : il[1];
159
+
160
+ return m(
161
+ "li.flexrow",
162
+ {
163
+ class: clase
164
+ },
165
+ [
166
+ m(Icon, {
167
+ iconClass: "unitsize",
168
+ icon: ICONS[clase] || DEFAULT_ICON
169
+ }),
170
+ m(
171
+ ".instruction.grows",
172
+ typeof il === "string" ? il : il[0]
173
+ )
174
+ ]
175
+ );
176
+ }
177
+ )
178
+ )
179
+ ])
180
+ ]
181
+ )
182
+ ),
183
+
184
+ HowToWiget = defineWidget(
185
+ ({ attrs }) => {
186
+ const
187
+ { pageMetadata, metadata, relativeRoute, cdnModel, source } = attrs,
188
+ { howto, title, image } = pageMetadata,
189
+ parsedHowto = makeHowto(pageMetadata, metadata, relativeRoute),
190
+ tools = [
191
+
192
+ ...howto.youtube ? [
193
+ m(YouTube, {
194
+ class: "col-12 cornered",
195
+ videoItem: howto.youtube
196
+ })
197
+ ] : [],
198
+
199
+ ...howto.supply
200
+ ? [
201
+ m(
202
+ BootCol,
203
+ {
204
+ el: "li",
205
+ iel: "ul",
206
+ class: "pad-1 lighter grows howtolist supplies col-12 col-sm-6 col-md-12",
207
+ subclass: "feature text-al-center shadow-2 bg-accent-light col-12"
208
+ },
209
+ [
210
+ m(
211
+ "li.flexcol.titrow",
212
+ [
213
+ m(Icon, {
214
+ iconClass: "pad-1",
215
+ icon: ICONS.supply
216
+ }),
217
+ m("h2.supply.grows", "Requirements")
218
+ ]
219
+ ),
220
+ ...howto.supply.map((s) => m(
221
+ "li.flexrow",
222
+ {},
223
+ [
224
+ m(".supply.grows", s)
225
+ ]
226
+ ))
227
+ ]
228
+ )
229
+ ]
230
+ : [],
231
+
232
+ ...howto.tool
233
+ ? [
234
+ m(
235
+ BootCol,
236
+ {
237
+ el: "li",
238
+ iel: "ul",
239
+ class: "pad-1 lighter grows howtolist tools col-12 col-sm-6 col-md-12",
240
+ subclass: "feature text-al-center shadow-2 bg-accent-light col-12"
241
+ },
242
+ [
243
+ m(
244
+ "li.flexcol.titrow",
245
+ {},
246
+ [
247
+ m(Icon, {
248
+ iconClass: "pad-1",
249
+ icon: ICONS.tool
250
+ }),
251
+ m("h2.tool.grows", "Tools needed")
252
+ ]
253
+ ),
254
+ ...howto.tool.map((tool) => m(
255
+ "li.flexrow",
256
+ {},
257
+ [
258
+ m(".tool.grows", tool)
259
+ ]
260
+ ))
261
+ ]
262
+ )
263
+ ]
264
+ : []
265
+ ];
266
+
267
+ return m(".flexrow.w-100.h-100", [
268
+ m.trust(createHtml(parsedHowto)),
269
+ m(
270
+ "ul.flexrow.h-100.grows.wrap.scrolly.screen.fixboot.howto",
271
+ {
272
+ class: pageMetadata.class,
273
+ "aria-label": title
274
+ },
275
+ [
276
+
277
+ m(
278
+ BootCol,
279
+ {
280
+ el: "li",
281
+ label: title,
282
+ class: "pad-1 lighter col-12 col-md-8 grows screen",
283
+ subclass: "feature ohidden text-al-center shadow-2"
284
+ },
285
+ [
286
+ m(ItemTile, {
287
+ class: "flexrow wrap ohidden",
288
+ items: [
289
+
290
+ {
291
+ class: "col-12 pad-6",
292
+ el: "h1",
293
+ text: title
294
+ },
295
+
296
+ {
297
+ el: "h5",
298
+ class: "fabf fa-clock col-3 grows",
299
+ text: howto.totalTime
300
+ },
301
+
302
+ ...howto.step
303
+ ? [
304
+ {
305
+ el: "h5",
306
+ class: "fabf fa-list col-3 grows",
307
+ text: howto.step.length
308
+ }
309
+ ]
310
+ : [],
311
+
312
+ ...howto.estimatedCost
313
+ ? [
314
+ {
315
+ el: "h5.fabf.col-3.grows",
316
+ class: "fa-" + (ICONS[howto.estimatedCost.currency] || "money-bill"),
317
+ text: String(howto.estimatedCost.value)
318
+ }
319
+ ] : [],
320
+
321
+ ...image ? [
322
+ {
323
+ class: "always-grows col-12 obsimage marg-v no-marg-bottom",
324
+ image: image.url,
325
+ alt: image.alt
326
+
327
+ }] : [],
328
+
329
+ ...howto.text ? [
330
+ {
331
+ class: "pad-6 pad-h col-12 al-left scaff-bottom markdown",
332
+ text: convert(howto.text, { metadata: attrs.metadata, relativeRoute: attrs.relativeRoute }).html
333
+ }] : []
334
+
335
+ ]
336
+ })
337
+ ]
338
+ ),
339
+
340
+ m("li.col-12.col-md-4.grows.flexrow", {}, [
341
+ m("ul.col-12.flexrow.wrap", tools)
342
+ ]),
343
+
344
+ ...howto.step
345
+ ? [
346
+ m("ol.pad-0.marg-0.col-12", [
347
+ howto.step.map((step, idx) => m(
348
+ HowToStep,
349
+ {
350
+ ...step,
351
+ size: 3,
352
+ class: "pad-2 screen",
353
+ index: idx + 1,
354
+ metadata,
355
+ relativeRoute
356
+ },
357
+ []
358
+ ))
359
+ ])]
360
+ : [],
361
+
362
+ ...howto.publisher || howto.author
363
+ ? [
364
+ m(
365
+ BootCol,
366
+ {
367
+ el: "li",
368
+ class: "pad-1 lighter col-12 screen",
369
+ subclass: "feature text-al-center pad-6 shadow-2",
370
+ label: "publisher and author"
371
+ },
372
+ [
373
+ m(ItemTile, {
374
+ class: "flexrow wrap ohidden",
375
+ items: [
376
+ ...howto.publisher.name ? [
377
+ {
378
+ el: "h5",
379
+ class: "col-5 grows",
380
+ text: "published by " + howto.publisher.name
381
+ }
382
+ ] : [],
383
+ ...howto.author.name ? [
384
+ {
385
+ el: "h5",
386
+ class: "col-5 grows",
387
+ text: "written by " + howto.author.name
388
+ }
389
+ ] : []
390
+
391
+ ]
392
+ })
393
+ ]
394
+ )
395
+ ] : [],
396
+
397
+ ...pageMetadata.footer
398
+ ? [
399
+ m(
400
+ "li",
401
+ { "aria-label": pageMetadata.footer.title || "footer", class: "col-12" },
402
+ m(TailWidget, { li: true, class: "shadow-2", ...pageMetadata.footer })
403
+ )
404
+ ]
405
+ : []
406
+ ]
407
+ ),
408
+ m(RightSide, {
409
+ cdnModel,
410
+ source,
411
+ class: "grows d-none d-xl-flex",
412
+ ncsdom: metadata.site.domain
413
+ })
414
+ // m("script", FaqScript("step"))
415
+ ]);
416
+ }
417
+ );
418
+
419
+ module.exports = HowToWiget;
@@ -0,0 +1,51 @@
1
+ const
2
+ m = require("mithril"),
3
+ defineWidget = require("../util/widgets/util.definewidget"),
4
+ { YouTube } = require("../widgets.features/Youtube");
5
+
6
+ const
7
+ ItemBody = defineWidget(
8
+ ({ attrs }) => (
9
+ attrs.image
10
+ ? m(
11
+ ".obsimage",
12
+ { class: attrs.class },
13
+ m("img.w-100", { alt: attrs.alt, src: attrs.image, class: attrs.imageClass || "" })
14
+ )
15
+ : attrs.youtube
16
+ ? m(YouTube, {
17
+ class: attrs.class,
18
+ videoItem: attrs.youtube
19
+ })
20
+ : attrs.link
21
+ ? m(
22
+ "a.paralink",
23
+ {
24
+ href: attrs.link.href,
25
+ class: attrs.link.class
26
+ },
27
+ attrs.link.text
28
+ )
29
+
30
+ : attrs.text
31
+ ? m(
32
+ attrs.el || ".paragraph.col-12",
33
+ { class: attrs.class || "" },
34
+ m.trust(attrs.text)
35
+ )
36
+ : m(".d-none")
37
+ )
38
+ ),
39
+
40
+ ItemTile = defineWidget(
41
+ ({ attrs }) => m(
42
+ ".titler",
43
+ {
44
+ class: attrs.class || "flexcol grows",
45
+ role: "presentation"
46
+ },
47
+ attrs.items.map((item) => m(ItemBody, item))
48
+ )
49
+ );
50
+
51
+ module.exports = { ItemBody, ItemTile };
@@ -0,0 +1,31 @@
1
+ module.exports = (name) => `
2
+ (function() {
3
+ function FaqSelect(target) {
4
+ target = target || 0;
5
+ const questions = document.getElementsByClassName("contractable");
6
+ let current = 0;
7
+ let currell = null;
8
+ for (const question of questions) {
9
+ question.classList.toggle("contracted", target !== current);
10
+ question.classList.toggle("expanded", target === current);
11
+ if (target===current) question.scrollIntoView({behavior:"smooth"});
12
+ current++;
13
+ }
14
+ }
15
+
16
+ const initial = window.location.hash.split("#${name}-")[1];
17
+ const questions = document.getElementsByClassName("contractable");
18
+
19
+ for (const question of questions) {
20
+ question.addEventListener("click", function (e) {
21
+ const idx = e.target.getAttribute("data-index");
22
+ if (idx) {
23
+ FaqSelect(parseInt(idx) - 1);
24
+ window.history.replaceState({}, "", "#${name}-"+idx);
25
+ }
26
+ });
27
+ }
28
+
29
+ if (initial) FaqSelect(parseInt(initial) - 1);
30
+ }());
31
+ `;