@things-factory/help 8.0.0-beta.0 → 8.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/help",
3
- "version": "8.0.0-beta.0",
3
+ "version": "8.0.0-beta.2",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -30,7 +30,7 @@
30
30
  "@material/web": "^2.0.0",
31
31
  "@operato/help": "^8.0.0-beta",
32
32
  "@operato/layout": "^8.0.0-beta",
33
- "@things-factory/shell": "^8.0.0-beta.0"
33
+ "@things-factory/shell": "^8.0.0-beta.2"
34
34
  },
35
- "gitHead": "add6fb8224b2cb19cbea47bed6a5ecb0424c9a28"
35
+ "gitHead": "f03431a09435511b2595515658f9cb8f78ba4ebb"
36
36
  }
@@ -1,18 +0,0 @@
1
- import '@operato/help/ox-help-panel.js'
2
-
3
- import { html } from 'lit-html'
4
-
5
- import { appendViewpart, VIEWPART_POSITION, VIEWPART_LEVEL } from '@operato/layout'
6
-
7
- export default function bootstrap() {
8
- appendViewpart({
9
- name: 'help',
10
- viewpart: {
11
- show: false,
12
- hovering: 'edge',
13
- template: html` <ox-help-panel></ox-help-panel> `,
14
- zIndex: 100
15
- },
16
- position: VIEWPART_POSITION.ASIDEBAR
17
- })
18
- }
package/client/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@operato/help'
package/client/route.ts DELETED
@@ -1,7 +0,0 @@
1
- export default function route(page) {
2
- switch (page) {
3
- case 'help':
4
- import('@operato/help/ox-help-home.js')
5
- return page
6
- }
7
- }
@@ -1,57 +0,0 @@
1
- body {
2
- --help-panel-background-color: var(--md-sys-color-surface-variant);
3
- --help-panel-width: 450px;
4
- --help-panel-margin: 0;
5
- --help-panel-padding: var(--padding-default) 0 var(--padding-default) var(--padding-wide);
6
- --help-panel-border-raidus: 9px;
7
- --help-panel-box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.15);
8
- --help-panel-border: 2px solid var(--md-sys-color-primary);
9
-
10
- --help-panel-color: var(--md-sys-color-on-surface-variant);
11
-
12
- --help-panel-title-margin: var(--margin-default) 0 var(--margin-narrow) 0;
13
- --help-panel-title-padding: 0;
14
- --help-panel-title-background-color: var(--md-sys-color-surface);
15
- --help-panel-h1-title-font-size: 1.6em;
16
- --help-panel-h1-title-color: var(--md-sys-color-primary);
17
- --help-panel-h2-title-font-size: 1.3em;
18
- --help-panel-h2-title-color: var(--md-sys-color-secondary);
19
- --help-panel-h3-title-font-size: 1.1em;
20
- --help-panel-h3-title-color: var(--secondary-text-color);
21
-
22
- --help-panel-content-padding: var(--padding-default) var(--padding-wide);
23
- --help-panel-paragraph-margin: 0 0 var(--margin-default) 0;
24
- --help-panel-font-size: 0.9em;
25
- --help-panel-content-font-size: 0.8em;
26
-
27
- --help-panel-focusBox-padding: var(--padding-narrow) var(--padding-default);
28
- --help-panel-focusBox-border: 1px solid rgba(0, 0, 0, 0.2);
29
- --help-panel-focusBox-border-radius: var(--border-radius);
30
- --help-panel-focusBox-background-color: rgba(0, 0, 0, 0.2);
31
- --help-panel-focusBox-color: #ffe393;
32
-
33
- --help-panel-a-color: var(--md-sys-color-secondary);
34
- --help-panel-a-icon-size: 1.3em;
35
-
36
- --help-icon-color: var(--md-sys-color-secondary);
37
- --help-icon-hover-color: var(--md-sys-color-primary);
38
- --help-icon-size: 18px;
39
- --help-icon-opacity: 0.4;
40
- --help-icon-hover-opacity: 1;
41
-
42
- --help-navigation-padding: 0;
43
- --help-navigation-bottom: var(--md-sys-color-surface-variant);
44
- --help-navigation-icon-padding: 10px;
45
- --help-navigation-icon-border: 1px solid rgba(0, 0, 0, 0.1);
46
- }
47
-
48
- @media only screen and (max-width: 460px) {
49
- body {
50
- --help-panel-width: 100vw;
51
- --help-panel-border-raidus: 0;
52
- --help-panel-border: none;
53
- --help-panel-box-shadow: none;
54
-
55
- --help-panel-title-padding: 0 0 0 var(--padding-wide);
56
- }
57
- }
package/server/index.ts DELETED
@@ -1 +0,0 @@
1
- import './routes'
@@ -1,82 +0,0 @@
1
- import Router from 'koa-router'
2
- import path from 'path'
3
-
4
- export const helpRouter = new Router()
5
-
6
- var fs = require('fs')
7
-
8
- process.on('client-rebuilt' as any, (app, compilerFileSystem) => {
9
- /* change filesystem whenever webpacking assets done. only for development mode. */
10
- fs = compilerFileSystem
11
- })
12
-
13
- helpRouter.get('/(.+)/index.md', async (context, next) => {
14
- const appRootPath = path.resolve('.')
15
- const PUBLIC_ROOT = path.resolve(appRootPath, 'dist-app') // webpack config output.path
16
- const { path: pathname } = context
17
- const folder = pathname.slice(0, pathname.lastIndexOf('/index.md'))
18
- const folderName = PUBLIC_ROOT + folder
19
-
20
- if (fs.existsSync(`${folderName}/index.md`)) {
21
- context.url = `${pathname}`
22
- return next()
23
- }
24
-
25
- // If index.md doesn't exist, list topics in the folder
26
- const topicList = []
27
-
28
- // List all files in the folder
29
- const folderContents = fs.readdirSync(folderName)
30
-
31
- // Loop through the files to find matching topics
32
- for (const file of folderContents) {
33
- // Check if the file matches the {topic}.{locale}.md pattern
34
- const topicLocaleMatch = file.match(/(.+)\.(.+)\.md/)
35
- if (topicLocaleMatch) {
36
- const [, topic, locale] = topicLocaleMatch
37
- topicList.push(`- [${topic}](${folder}/${topic}.md)`)
38
- } else {
39
- // Check if the file matches the {topic}.md pattern
40
- const topicMatch = file.match(/(.+)\.md/)
41
- if (topicMatch) {
42
- const [, topic] = topicMatch
43
- topicList.push(`- [${topic}](${folder}/${topic}.md)`)
44
- }
45
- }
46
- }
47
-
48
- // If topics are found, return the list in markdown format
49
- if (topicList.length > 0) {
50
- const uniqueList = [...new Set(topicList)]
51
- const topicListMarkdown = [`# ${folder}`, ...uniqueList].join('\n\n')
52
- context.body = topicListMarkdown
53
- context.type = 'text/markdown; charset=UTF-8'
54
- } else {
55
- // If no topics found, you can return a message or handle it as you like
56
- context.body = 'No topics found in this folder.'
57
- }
58
- })
59
-
60
- helpRouter.get('/(.+).md', async (context, next) => {
61
- const appRootPath = path.resolve('.')
62
- const PUBLIC_ROOT = path.resolve(appRootPath, 'dist-app') // webpack config output.path
63
-
64
- const { language, i18next, path: pathname } = context
65
-
66
- const filePath = PUBLIC_ROOT + pathname
67
- const fileName = filePath.slice(0, filePath.lastIndexOf('.md'))
68
- const pathnameNoExt = pathname.slice(0, pathname.lastIndexOf('.md'))
69
-
70
- var fallbacks = language.indexOf('-') !== -1 ? [language.split('-')[0]] : []
71
- const fallbackLng = i18next?.options?.fallbackLng
72
- if (fallbackLng && !fallbacks.includes(fallbackLng)) {
73
- fallbacks.push(fallbackLng)
74
- }
75
-
76
- var loc = [language, ...fallbacks].find(loc => fs.existsSync(`${fileName}.${loc}.md`))
77
- if (loc !== undefined) {
78
- context.url = `${pathnameNoExt}.${loc}.md`
79
- }
80
-
81
- return next()
82
- })
package/server/routes.ts DELETED
@@ -1,5 +0,0 @@
1
- import { helpRouter } from './routers/help-router'
2
-
3
- process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {
4
- globalPublicRouter.use('/helps', helpRouter.routes(), helpRouter.allowedMethods())
5
- })