@rws-framework/client 2.0.6

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 (116) hide show
  1. package/.bin/add-v.sh +10 -0
  2. package/.eslintrc.json +53 -0
  3. package/.setup/.eslintrc.json +11 -0
  4. package/.setup/tsconfig.json +29 -0
  5. package/README.md +691 -0
  6. package/_rws_externals.js +40 -0
  7. package/_tools.js +317 -0
  8. package/console.js +87 -0
  9. package/declarations.d.ts +9 -0
  10. package/docs/.nojekyll +1 -0
  11. package/docs/assets/26e93147f10415a0ed4a.svg +6 -0
  12. package/docs/assets/75c9471662e97ee24f29.svg +7 -0
  13. package/docs/assets/db90e4df2373980c497d.svg +9 -0
  14. package/docs/assets/hierarchy.css +1 -0
  15. package/docs/assets/hierarchy.js +1 -0
  16. package/docs/assets/highlight.css +120 -0
  17. package/docs/assets/main.js +59 -0
  18. package/docs/assets/navigation.js +1 -0
  19. package/docs/assets/search.js +1 -0
  20. package/docs/assets/style.css +1414 -0
  21. package/docs/classes/ApiServiceInstance.html +20 -0
  22. package/docs/classes/DOMServiceInstance.html +10 -0
  23. package/docs/classes/NotifyServiceInstance.html +12 -0
  24. package/docs/classes/RWSClient.html +11 -0
  25. package/docs/classes/RWSRouter.html +9 -0
  26. package/docs/classes/RWSService.html +7 -0
  27. package/docs/classes/RWSUploader.html +35 -0
  28. package/docs/classes/RWSViewComponent.html +24 -0
  29. package/docs/classes/RouterComponent.html +31 -0
  30. package/docs/classes/RoutingServiceInstance.html +13 -0
  31. package/docs/classes/UtilsServiceInstance.html +11 -0
  32. package/docs/classes/WSServiceInstance.html +32 -0
  33. package/docs/functions/RWSView.html +1 -0
  34. package/docs/functions/ngAttr.html +1 -0
  35. package/docs/functions/registerRWSComponents.html +1 -0
  36. package/docs/functions/renderRouteComponent.html +1 -0
  37. package/docs/hierarchy.html +1 -0
  38. package/docs/index.html +53 -0
  39. package/docs/interfaces/IRWSAssetShowOptions.html +1 -0
  40. package/docs/interfaces/IRWSConfig.html +11 -0
  41. package/docs/interfaces/IRWSDecoratorOptions.html +4 -0
  42. package/docs/interfaces/IRWSHttpRoute.html +3 -0
  43. package/docs/interfaces/IRWSPrefixedHTTProutes.html +3 -0
  44. package/docs/interfaces/IRoutingEvent.html +3 -0
  45. package/docs/modules.html +39 -0
  46. package/docs/types/DOMOutputType.html +1 -0
  47. package/docs/types/IRWSBackendRoute.html +1 -0
  48. package/docs/types/IRWSFrontRoutes.html +1 -0
  49. package/docs/types/IRWSRouteResult.html +1 -0
  50. package/docs/types/IRWSWebsocketStatus.html +1 -0
  51. package/docs/types/NotifyLogType.html +1 -0
  52. package/docs/types/NotifyUiType.html +1 -0
  53. package/docs/types/RWSNotify.html +1 -0
  54. package/docs/types/RouteReturn.html +1 -0
  55. package/docs/variables/ApiService.html +1 -0
  56. package/docs/variables/DOMService.html +1 -0
  57. package/docs/variables/NotifyService.html +1 -0
  58. package/docs/variables/RoutingService.html +1 -0
  59. package/docs/variables/UtilsService.html +1 -0
  60. package/docs/variables/WSService.html +1 -0
  61. package/docs/variables/_ROUTING_EVENT_NAME.html +1 -0
  62. package/package.json +93 -0
  63. package/package.webpack.config.js +17 -0
  64. package/rws.webpack.config.js +260 -0
  65. package/src/client.ts +304 -0
  66. package/src/components/_attrs/angular-attr.ts +64 -0
  67. package/src/components/_attrs/sanitize-html.ts +81 -0
  68. package/src/components/_component.ts +290 -0
  69. package/src/components/_container.ts +16 -0
  70. package/src/components/_decorator.ts +112 -0
  71. package/src/components/_design_system.ts +6 -0
  72. package/src/components/index.ts +9 -0
  73. package/src/components/progress/component.ts +55 -0
  74. package/src/components/progress/styles/layout.scss +91 -0
  75. package/src/components/progress/template.html +25 -0
  76. package/src/components/router/component.ts +67 -0
  77. package/src/components/uploader/component.ts +75 -0
  78. package/src/components/uploader/styles/layout.scss +105 -0
  79. package/src/components/uploader/template.html +17 -0
  80. package/src/hmr.ts +19 -0
  81. package/src/index.ts +98 -0
  82. package/src/interfaces/IRWSConfig.ts +24 -0
  83. package/src/interfaces/IRWSUser.ts +7 -0
  84. package/src/interfaces/IRWSViewComponent.ts +37 -0
  85. package/src/interfaces/RWSWindow.ts +39 -0
  86. package/src/routing/_router.ts +59 -0
  87. package/src/routing/index.ts +7 -0
  88. package/src/run.ts +35 -0
  89. package/src/service_worker/src/_service_worker.ts +88 -0
  90. package/src/service_worker/tsconfig.json +21 -0
  91. package/src/service_worker/webpack.config.js +67 -0
  92. package/src/services/ApiService.ts +241 -0
  93. package/src/services/ConfigService.ts +107 -0
  94. package/src/services/DOMService.ts +91 -0
  95. package/src/services/NotifyService.ts +49 -0
  96. package/src/services/RoutingService.ts +46 -0
  97. package/src/services/ServiceWorkerService.ts +60 -0
  98. package/src/services/UtilsService.ts +103 -0
  99. package/src/services/WSService.ts +218 -0
  100. package/src/services/_service.ts +50 -0
  101. package/src/services/_ws_handlers/ConnectionHandler.ts +52 -0
  102. package/src/services/_ws_handlers/EventHandler.ts +28 -0
  103. package/src/services/_ws_handlers/MessageHandler.ts +49 -0
  104. package/src/styles/includes.scss +102 -0
  105. package/src/types/RWSNotify.ts +7 -0
  106. package/tsconfig.json +27 -0
  107. package/typedoc.json +13 -0
  108. package/webpack/after/copy.js +73 -0
  109. package/webpack/after/sw.js +14 -0
  110. package/webpack/index.js +11 -0
  111. package/webpack/rws_after_plugin.js +80 -0
  112. package/webpack/rws_fast_css_loader.js +16 -0
  113. package/webpack/rws_fast_html_loader.js +4 -0
  114. package/webpack/rws_fast_scss_loader.js +50 -0
  115. package/webpack/rws_fast_ts_loader.js +134 -0
  116. package/webpack/rws_plugin.js +337 -0
@@ -0,0 +1,40 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const tools = require('./_tools');
5
+
6
+ const _defaultOpts = {
7
+ inc_list_context: [],
8
+ inc_list: [],
9
+ not_inc_list: [],
10
+ not_inc_list_context: ['rws-js-client', 'node_modules'],
11
+ exceptions: [],
12
+ exceptions_context: [],
13
+ }
14
+
15
+ const moduleDir = path.resolve(path.dirname(module.id));
16
+ const nodeModules = path.resolve(tools.findRootWorkspacePath(process.cwd()), '/node_modules');
17
+
18
+
19
+ const externals = (declaredCodeBase, nodeModules, externalOptions = _defaultOpts) => ({context, request}, callback) => {
20
+ let theOptions = _defaultOpts;
21
+
22
+ if(externalOptions !== null){
23
+ theOptions = Object.assign(theOptions, externalOptions);
24
+ }
25
+
26
+ const codeBase = path.resolve(declaredCodeBase);
27
+
28
+ let mergeTarget = true;
29
+ console.log('req', context, request, mergeTarget);
30
+
31
+ if (mergeTarget) {
32
+ //merging to output
33
+ return callback();
34
+ }
35
+
36
+ //using require from node_modules
37
+ callback(null, 'commonjs ' + request);
38
+ }
39
+
40
+ module.exports = {rwsExternals: externals, _externalsDefaults: _defaultOpts};
package/_tools.js ADDED
@@ -0,0 +1,317 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const ts = require('typescript');
4
+ const { spawn } = require('child_process');
5
+ const JSON5 = require('json5');
6
+
7
+ function findRootWorkspacePath(currentPath) {
8
+ const parentPackageJsonPath = path.join(currentPath + '/..', 'package.json');
9
+ const parentPackageDir = path.dirname(parentPackageJsonPath);
10
+
11
+ if (fs.existsSync(parentPackageJsonPath)) {
12
+ const packageJson = JSON.parse(fs.readFileSync(parentPackageJsonPath, 'utf-8'));
13
+
14
+ if (packageJson.workspaces) {
15
+ return this.findRootWorkspacePath(parentPackageDir);
16
+ }
17
+ }
18
+
19
+ return currentPath;
20
+ }
21
+
22
+ function findPackageDir()
23
+ {
24
+ return path.resolve(path.dirname(module.id));
25
+ }
26
+
27
+ function getActiveWorkSpaces(currentPath, mode = 'all') {
28
+ if(!currentPath){
29
+ throw new Error(`[_tools.js:getActiveWorkSpaces] "currentPath" argument is required.`);
30
+ }
31
+
32
+ if(!(['all', 'frontend', 'backend'].includes(mode))){
33
+ throw new Error(`[_tools.js:getActiveWorkSpaces] "mode" argument can be only: "frontend", "backend" or "all".`);
34
+ }
35
+
36
+ const rootPkgDir = findRootWorkspacePath(currentPath)
37
+ const parentPackageJsonPath = path.join(rootPkgDir, 'package.json');
38
+ const parentPackageDir = path.dirname(parentPackageJsonPath);
39
+
40
+ if (fs.existsSync(parentPackageJsonPath)) {
41
+ const packageJson = JSON.parse(fs.readFileSync(parentPackageJsonPath, 'utf-8'));
42
+
43
+ if (packageJson.workspaces) {
44
+ return packageJson.workspaces.map((workspaceName) => path.join(rootPkgDir, workspaceName)).filter((workspaceDir) => {
45
+ if(mode === 'all'){
46
+ return true;
47
+ }
48
+
49
+ let rwsPkgName = 'rws-js-server';
50
+
51
+ if(mode === 'frontend'){
52
+ rwsPkgName = 'rws-js-client';
53
+ }
54
+
55
+ let hasDesiredPackage = false;
56
+
57
+ const workspaceWebpackFilePath = path.join(workspaceDir, 'package.json');
58
+ const workspacePackageJson = JSON.parse(fs.readFileSync(workspaceWebpackFilePath, 'utf-8'));
59
+
60
+ if (workspacePackageJson.dependencies && (!!workspacePackageJson.dependencies[rwsPkgName])) {
61
+ hasDesiredPackage = true;
62
+ }
63
+
64
+ return hasDesiredPackage;
65
+ });
66
+ }
67
+ }
68
+
69
+ return [currentPath];
70
+ }
71
+
72
+ async function runCommand(command, cwd = null, silent = false, extraArgs = { env: {}}) {
73
+ return new Promise((resolve, reject) => {
74
+ const [cmd, ...args] = command.split(' ');
75
+
76
+ if(!cwd){
77
+ console.log(`[RWS] Setting default CWD for "${command}"`);
78
+ cwd = process.cwd();
79
+ }
80
+
81
+
82
+ const env = { ...process.env, ...extraArgs.env };
83
+
84
+ console.log(`[RWS] Running command "${command}" from "${cwd}"`);
85
+
86
+ const spawned = spawn(cmd, args, { stdio: silent ? 'ignore' : 'inherit', cwd, env });
87
+
88
+ spawned.on('exit', (code) => {
89
+ if (code !== 0) {
90
+ return reject(new Error(`Command failed with exit code ${code}`));
91
+ }
92
+ resolve();
93
+ });
94
+
95
+ spawned.on('error', (error) => {
96
+ reject(error);
97
+ });
98
+ });
99
+ }
100
+
101
+ function findSuperclassFilePath(entryFile){
102
+ const program = ts.createProgram([entryFile], {
103
+ target: ts.ScriptTarget.ES5,
104
+ module: ts.ModuleKind.CommonJS
105
+ });
106
+ const checker = program.getTypeChecker();
107
+
108
+ for (const sourceFile of program.getSourceFiles()) {
109
+ if (!sourceFile.isDeclarationFile) {
110
+ ts.forEachChild(sourceFile, visit);
111
+ }
112
+ }
113
+
114
+ function visit(node) {
115
+ if (ts.isClassDeclaration(node) && node.heritageClauses) {
116
+ for (const clause of node.heritageClauses) {
117
+ if (clause.token === ts.SyntaxKind.ExtendsKeyword) {
118
+ for (const type of clause.types) {
119
+ const symbol = checker.getSymbolAtLocation(type.expression);
120
+ if (symbol && symbol.declarations) {
121
+ const declaration = symbol.declarations[0];
122
+ const sourceFile = declaration.getSourceFile();
123
+ return sourceFile.fileName; // Returns the file path of the first superclass it finds
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ ts.forEachChild(node, visit);
131
+ }
132
+
133
+ return null; // Return null if no superclass or file path is found
134
+ }
135
+
136
+ function findServiceFilesWithClassExtend(dir, classPath){
137
+ const files = fs.readdirSync(dir);
138
+ let results = []
139
+
140
+ files.forEach(file => {
141
+ const filePath = path.join(dir, file);
142
+ const fileStat = fs.statSync(filePath);
143
+
144
+ if (fileStat.isDirectory()) {
145
+ results = [...results, ...findServiceFilesWithClassExtend(filePath, classPath)];
146
+ } else if (fileStat.isFile() && filePath.endsWith('.ts')) {
147
+ const foundPath = findSuperclassFilePath(filePath);
148
+ if(foundPath === classPath){
149
+ results = [...results, filePath];
150
+ }
151
+ };
152
+ });
153
+
154
+ return results;
155
+ }
156
+
157
+ function findComponentFilesWithText(dir, text, ignored = [], fileList = []){
158
+ const files = fs.readdirSync(dir);
159
+
160
+ files.forEach(file => {
161
+ const filePath = path.join(dir, file);
162
+ const fileStat = fs.statSync(filePath);
163
+
164
+ if (fileStat.isDirectory() && !ignored.includes(file)) {
165
+ // Recursively search this directory
166
+ findComponentFilesWithText(filePath, text, ignored, fileList);
167
+ } else if (fileStat.isFile() && filePath.endsWith('.ts')) {
168
+ // Read file content and check for text
169
+ const content = fs.readFileSync(filePath, 'utf8');
170
+ if (content.includes(text)) {
171
+ const compInfo = extractComponentInfo(content);
172
+ if(compInfo){
173
+ const {tagName, className, options, isIgnored} = compInfo;
174
+
175
+ if(isIgnored){
176
+ return;
177
+ }
178
+
179
+ // const fileParts = filePath.split('/');
180
+ // const fpLen = fileParts.length;
181
+
182
+ fileList.push({
183
+ filePath,
184
+ tagName,
185
+ className,
186
+ sanitName: className.toLowerCase(),
187
+ content,
188
+ isIgnored: options?.ignorePackaging
189
+ });
190
+ }
191
+ }
192
+ }
193
+ });
194
+
195
+ return fileList;
196
+ }
197
+
198
+ function extractRWSViewArguments(sourceFile){
199
+ let argumentsExtracted = {
200
+ className: null,
201
+ tagName: null,
202
+ options: null
203
+ };
204
+
205
+ let foundDecorator = false;
206
+
207
+ function visit(node) {
208
+ if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {
209
+ const expression = node.expression;
210
+ const decoratorName = expression.expression.getText(sourceFile);
211
+ if (decoratorName === 'RWSView') {
212
+ foundDecorator = true;
213
+ const args = expression.arguments;
214
+ if (args.length > 0 && ts.isStringLiteral(args[0])) {
215
+ argumentsExtracted.tagName = args[0].text;
216
+ }
217
+ if (args.length > 1) {
218
+ if (ts.isObjectLiteralExpression(args[1])) {
219
+ const argVal = args[1].getText(sourceFile);
220
+ argumentsExtracted.options = JSON5.parse(argVal);
221
+ }
222
+ }
223
+
224
+ if (node.parent && ts.isClassDeclaration(node.parent)) {
225
+ const classNode = node.parent;
226
+ if (classNode.name) { // ClassDeclaration.name is optional as classes can be unnamed/anonymous
227
+ argumentsExtracted.className = classNode.name.getText(sourceFile);
228
+ }
229
+ }
230
+ }
231
+ }
232
+
233
+ ts.forEachChild(node, visit);
234
+ }
235
+
236
+ visit(sourceFile);
237
+
238
+ if(!foundDecorator){
239
+ return null;
240
+ }
241
+
242
+ return argumentsExtracted;
243
+ }
244
+
245
+ function extractRWSIgnoreArguments(sourceFile){
246
+ let argumentsExtracted = {
247
+ params: null,
248
+ };
249
+ let foundDecorator = false;
250
+ let ignored = false;
251
+
252
+ function visit(node) {
253
+ if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {
254
+ const expression = node.expression;
255
+ const decoratorName = expression.expression.getText(sourceFile);
256
+ if (decoratorName === 'RWSView') {
257
+ foundDecorator = true;
258
+ const args = expression.arguments;
259
+
260
+ if (args.length) {
261
+ // Assuming the second argument is an object literal
262
+ if (ts.isObjectLiteralExpression(args[0])) {
263
+ const argVal = args[0].getText(sourceFile);
264
+ argumentsExtracted.options = argVal;
265
+
266
+ if(argVal.ignorePackaging === true){
267
+ ignored = true;
268
+ }
269
+ }
270
+ }
271
+ }
272
+ }
273
+
274
+ ts.forEachChild(node, visit);
275
+ }
276
+
277
+ visit(sourceFile);
278
+
279
+ if(!foundDecorator){
280
+ return true;
281
+ }
282
+
283
+ return ignored;
284
+ }
285
+
286
+ function extractComponentInfo(componentCode) {
287
+ const componentNameRegex = /\@RWSView/g;
288
+
289
+ if(!componentNameRegex.test(componentCode)){
290
+ return;
291
+ }
292
+
293
+ const tsSourceFile = ts.createSourceFile(`/tmp/temp_ts`, componentCode, ts.ScriptTarget.Latest, true);
294
+
295
+ let decoratorArgs = extractRWSViewArguments(tsSourceFile);
296
+
297
+ if(!decoratorArgs){
298
+ decoratorArgs = {};
299
+ }
300
+
301
+ decoratorOpts = decoratorArgs.options;
302
+
303
+ return {...decoratorArgs, options: decoratorOpts };
304
+ }
305
+
306
+ module.exports = {
307
+ findRootWorkspacePath,
308
+ findPackageDir,
309
+ getActiveWorkSpaces,
310
+ runCommand,
311
+ findComponentFilesWithText,
312
+ extractComponentInfo,
313
+ extractRWSViewArguments,
314
+ extractRWSIgnoreArguments,
315
+ findServiceFilesWithClassExtend,
316
+ findSuperclassFilePath
317
+ }
package/console.js ADDED
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+
3
+ const chalk = require('chalk');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+ const tools = require('./_tools');
7
+
8
+ const moduleDir = path.resolve(__dirname);
9
+ const executionDir = path.resolve(process.cwd());
10
+ const workspaceRoot = tools.findRootWorkspacePath(executionDir);
11
+
12
+ const command2map = process.argv[2];
13
+ const firstArg = process.argv[3] || '';
14
+
15
+ const extraArgsAggregated = [];
16
+
17
+ if(process.argv.length > 4){
18
+ for(let i = 4; i <= process.argv.length-1;i++){
19
+ extraArgsAggregated.push(process.argv[i]);
20
+ }
21
+ }
22
+
23
+ const CMD_LIST = [
24
+ 'init',
25
+ 'build:sw'
26
+ ]
27
+
28
+ async function main() {
29
+ if(!CMD_LIST.includes(command2map) || command2map === 'help'){
30
+ const helpTxt = `RWS Client CLI. \n\n Main features: \n - framerwork init \n - tests \n\n`;
31
+ const cmdList = `Command list: \n ${CMD_LIST.map((el) => `"rws-client ${el}"`).join('\n')}`;
32
+ const currentColor = command2map === 'help' ? chalk.yellow : chalk.red
33
+
34
+ if(command2map === 'help'){
35
+ console.log(currentColor(helpTxt));
36
+ }
37
+
38
+ console.log(currentColor(cmdList))
39
+ return false;
40
+ }
41
+
42
+ switch(command2map){
43
+ case 'init': await initCmd(); break;
44
+ case 'build:sw': await buildSwCmd(); break;
45
+ }
46
+
47
+ return true;
48
+ }
49
+
50
+ async function initCmd(){
51
+ let workspaced = false;
52
+ if(workspaceRoot !== executionDir){
53
+ workspaced = true;
54
+ }
55
+
56
+ if(workspaced){
57
+ if(!fs.existsSync(`${executionDir}/.eslintrc.json`)){
58
+ const rcjs = fs.readFileSync(`${moduleDir}/.setup/.eslintrc.json`, 'utf-8');
59
+ fs.writeFileSync(`${executionDir}/.eslintrc.json`, rcjs.replace('{{frontend_dir}}', executionDir));
60
+ console.log(chalk.green('RWS CLI'), 'Installed eslint base workspace config file.');
61
+ }
62
+ }else{
63
+ if(!fs.existsSync(`${executionDir}/.eslintrc.json`)){
64
+ fs.copyFileSync(`${moduleDir}/.eslintrc.json`, `${executionDir}/.eslintrc.json`);
65
+ console.log(chalk.green('[RWS Client]'), 'Installed eslint config file.');
66
+ }
67
+ }
68
+
69
+ if(!fs.existsSync(`${executionDir}/tsconfig.json`)){
70
+ fs.copyFileSync(`${moduleDir}/.setup/tsconfig.json`, `${executionDir}/tsconfig.json`);
71
+ console.log(chalk.green('[RWS Client]'), 'Installed tsconfig.');
72
+ }
73
+ }
74
+
75
+ async function buildSwCmd(){
76
+ const webpackCmd = `yarn webpack`;
77
+
78
+ try {
79
+ console.log(chalk.yellow('[RWS Client]'), 'Installing service worker...');
80
+ await tools.runCommand(`${webpackCmd} --config ${path.resolve(moduleDir,'src','service_worker')}/webpack.config.js`, executionDir, false, { env: { SWPATH: firstArg } });
81
+ console.log(chalk.green('[RWS Client]'), 'Service worker installed.');
82
+ }catch(e){
83
+ console.error('runerror',e);
84
+ }
85
+ }
86
+
87
+ main().then((result) => {});
@@ -0,0 +1,9 @@
1
+ declare module '*.scss' {
2
+ const content: import('@microsoft/fast-element').ElementStyles;
3
+ export default content;
4
+ }
5
+
6
+ declare module '*.html' {
7
+ const content: import('@microsoft/fast-element').ViewTemplate;
8
+ export default content;
9
+ }
package/docs/.nojekyll ADDED
@@ -0,0 +1 @@
1
+ TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg fill="none" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
3
+ <title>TypeScript logo</title>
4
+ <rect width="512" height="512" rx="50" fill="#3178c6"/>
5
+ <path d="m317 407v50c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1c12 0 23-1.1 34-3.4 11-2.3 20-6.1 28-11 8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4 0.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1c3.2-2 7.2-3.5 12-4.6 4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6 0.31 13 0.94 4.6 0.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1c-12 0-23 1.3-34 3.8s-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-0.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-30-17zm-84-123h64v-41h-179v41h64v183h51z" clip-rule="evenodd" fill="#fff" fill-rule="evenodd" style="fill:#fff"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <svg viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <g id="#007bffff">
4
+ <path fill="#007bff" opacity="1.00"
5
+ d=" M 9.84 70.86 C 18.37 59.93 32.07 53.35 45.93 53.48 C 99.29 53.43 152.64 53.50 206.00 53.45 C 209.00 53.53 212.11 53.12 215.03 53.98 C 218.18 55.70 220.05 58.98 222.42 61.57 C 234.68 76.00 246.64 90.69 259.08 104.97 C 328.06 105.05 397.05 104.97 466.04 105.01 C 475.98 104.92 485.90 108.15 493.81 114.18 C 504.16 121.79 510.49 133.96 512.00 146.61 L 512.00 403.41 C 510.94 415.48 505.32 427.15 496.01 435.00 C 489.04 441.00 480.20 444.79 471.05 445.68 C 466.04 446.17 461.01 445.97 456.00 446.00 C 323.00 446.00 190.00 446.00 57.00 446.00 C 50.54 445.94 44.03 446.33 37.64 445.23 C 24.25 442.94 12.17 434.24 5.68 422.33 C 2.40 416.54 0.74 410.00 0.00 403.44 L 0.00 95.59 C 1.03 86.67 4.14 77.89 9.84 70.86 Z"/>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <svg viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <g id="#007bffff">
4
+ <path fill="#007bff" opacity="1.00"
5
+ d=" M 0.00 80.69 C 0.22 64.54 15.05 50.95 30.99 51.04 C 71.66 50.97 112.33 51.00 153.00 51.02 C 163.06 50.98 173.05 55.84 178.96 64.04 C 190.23 79.65 201.34 95.39 212.61 111.00 C 275.09 111.02 337.57 110.96 400.05 111.03 C 415.75 110.89 430.55 124.04 431.08 139.96 C 431.29 154.12 431.11 168.29 431.16 182.46 C 324.50 182.48 217.83 182.44 111.17 182.48 C 95.16 182.41 79.32 191.83 72.51 206.44 C 48.34 257.13 24.13 307.80 0.00 358.51 L 0.00 80.69 Z"/>
6
+ <path fill="#007bff" opacity="1.00"
7
+ d=" M 91.02 234.95 C 97.86 220.76 113.28 211.54 128.94 211.48 C 241.97 211.45 355.00 211.49 468.03 211.46 C 474.47 211.32 480.96 212.47 486.89 215.04 C 501.07 220.92 511.34 235.20 512.00 250.60 L 512.00 254.16 C 511.61 259.88 510.10 265.50 507.48 270.60 C 482.86 319.94 458.24 369.28 433.63 418.62 C 431.10 423.61 428.85 428.84 425.20 433.15 C 417.67 442.38 405.95 447.99 394.03 447.99 C 274.35 448.02 154.68 447.98 35.01 448.01 C 19.82 449.24 4.46 438.96 0.84 423.98 C 30.92 360.98 60.93 297.95 91.02 234.95 Z"/>
8
+ </g>
9
+ </svg>
@@ -0,0 +1 @@
1
+ .tree{background:var(--color-panel);margin-top:20px}.tree-config{display:flex;gap:8px;justify-content:end;padding:8px}.tree-config__button{align-items:center;background-color:transparent;border:0;color:var(--color-toolbar-text);cursor:pointer;display:flex;height:20px;justify-content:center;opacity:.8;padding:0;width:20px}.tree-config__button:hover{opacity:.9}.tree-content{color:var(--color-text);font-size:.85rem;font-weight:400;line-height:1.5;padding:0 20px 20px;position:relative}.tree-content span{font-size:13px;letter-spacing:.4px}.tree-content ul{list-style:none;margin:0;padding-left:5px}.tree-content ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-bottom:5px;padding-left:15px;padding-top:5px;position:relative}.tree-content ul li:before{height:1px;margin:auto;top:15px;width:10px}.tree-content ul li:after,.tree-content ul li:before{background-color:#666;content:"";left:0;position:absolute}.tree-content ul li:after{bottom:0;height:100%;top:0;width:1px}.tree-content ul li:last-child:after{height:15px}.tree-content ul a{cursor:pointer}.category:not([data-id=root]){display:none}.category:not([data-id=root])._open{display:block}.category__title{color:var(--color-text-aside);cursor:pointer}.category__link,.category__title{align-items:center;display:flex;flex-shrink:0;text-decoration:none}a.category__link:hover,a.category__title:hover{text-decoration:underline}.category__title._open .category__folder{background:url(db90e4df2373980c497d.svg)}.category__folder{background:url(75c9471662e97ee24f29.svg);display:inline-block;flex-shrink:0;height:15px;margin-right:6px;width:15px}.category__link._active{color:inherit}.category__link--ts:before{background-image:url(26e93147f10415a0ed4a.svg);content:"";display:inline-block;flex-shrink:0;height:15px;margin:0 7px 2px 0;vertical-align:middle;width:15px}
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={893:(e,t,s)=>{s.r(t)},393:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HierarchyManager=void 0;const a=s(98);t.HierarchyManager=class{constructor(){this.stateManager=new a.StateManager,this.titleSelector=".js-category-title",this.listSelector=".js-category-list"}init(){this.addListeners(),this.initSaved(),this.openCurrentPath()}openPathAndSave(e){this.openPath(e),this.stateManager.addOpenedPath(e)}openPath(e){const t=document.querySelector(`${this.listSelector}[data-id="${e}"]`);t&&(t.classList.add("_open"),t.parentNode?.querySelector(this.titleSelector)?.classList.add("_open"))}closePath(e){const t=document.querySelector(`${this.listSelector}[data-id="${e}"]`);t&&(t.classList.remove("_open"),t.parentNode?.querySelector(this.titleSelector)?.classList.remove("_open"),this.stateManager.removeOpenedPath(e))}closePathWithChildren(e){this.closePath(e);const t=document.querySelector(`${this.listSelector}[data-id="${e}"]`);if(!t)return;const s=t.querySelectorAll(this.listSelector);for(const e of s)this.closePath(e.dataset.id||"")}togglePath(e){const t=document.querySelector(`${this.listSelector}[data-id="${e}"]`);t&&(t.classList.contains("_open")?this.closePathWithChildren(e):this.openPathAndSave(e))}addListeners(){const e=document.querySelectorAll('.js-category-title:not([data-id="root"])');for(const t of e)t.addEventListener("click",(()=>{const e=t.dataset.id||"";this.togglePath(e)}));this.addExpandListener(),this.addCollapseListener(),this.addTargetListener()}addExpandListener(){document.querySelector(".js-tree-expand")?.addEventListener("click",(()=>{const e=document.querySelectorAll(this.listSelector);for(const t of e){const e=t.dataset.id||"";this.openPathAndSave(e)}}))}addCollapseListener(){document.querySelector(".js-tree-collapse")?.addEventListener("click",(()=>{const e=document.querySelectorAll(this.listSelector);for(const t of e){const e=t.dataset.id||"";this.closePath(e)}}))}addTargetListener(){document.querySelector(".js-tree-target")?.addEventListener("click",(()=>{this.openCurrentPath()?.scrollIntoView()}))}initSaved(){const e=this.stateManager.getOpenedPaths();for(const t of e)this.openPath(t)}openCurrentPath(){const e=window.location.pathname.split("/"),t=`/${e[e.length-2]||""}/${e[e.length-1]||""}`,s=document.querySelector(`.js-category-link[data-id="${t}"]`);if(!s)return null;s.classList.add("_active");let a=s.closest(this.listSelector);for(;a;){const e=a.dataset.id||"";this.openPath(e),a=a.parentNode.closest(this.listSelector)}return s}}},98:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StateManager=void 0;t.StateManager=class{constructor(){this.openedPathLsKey="opened-path-state",this.openedPaths=[];const e=localStorage.getItem("opened-path-state");this.openedPaths=e?JSON.parse(e):[]}addOpenedPath(e){this.openedPaths.push(e),this.updateState()}removeOpenedPath(e){this.openedPaths=this.openedPaths.filter((t=>t!==e)),this.updateState()}getOpenedPaths(){return this.openedPaths}updateState(){localStorage.setItem(this.openedPathLsKey,JSON.stringify(this.openedPaths))}}}},t={};function s(a){var o=t[a];if(void 0!==o)return o.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,s),r.exports}s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};(()=>{s(893);(new(s(393).HierarchyManager)).init()})()})();
@@ -0,0 +1,120 @@
1
+ :root {
2
+ --light-hl-0: #795E26;
3
+ --dark-hl-0: #DCDCAA;
4
+ --light-hl-1: #000000;
5
+ --dark-hl-1: #D4D4D4;
6
+ --light-hl-2: #A31515;
7
+ --dark-hl-2: #CE9178;
8
+ --light-hl-3: #001080;
9
+ --dark-hl-3: #9CDCFE;
10
+ --light-hl-4: #0070C1;
11
+ --dark-hl-4: #4FC1FF;
12
+ --light-hl-5: #0000FF;
13
+ --dark-hl-5: #569CD6;
14
+ --light-hl-6: #AF00DB;
15
+ --dark-hl-6: #C586C0;
16
+ --light-hl-7: #267F99;
17
+ --dark-hl-7: #4EC9B0;
18
+ --light-hl-8: #008000;
19
+ --dark-hl-8: #6A9955;
20
+ --light-hl-9: #098658;
21
+ --dark-hl-9: #B5CEA8;
22
+ --light-hl-10: #800000;
23
+ --dark-hl-10: #808080;
24
+ --light-hl-11: #800000;
25
+ --dark-hl-11: #569CD6;
26
+ --light-hl-12: #E50000;
27
+ --dark-hl-12: #9CDCFE;
28
+ --light-hl-13: #0000FF;
29
+ --dark-hl-13: #CE9178;
30
+ --light-code-background: #FFFFFF;
31
+ --dark-code-background: #1E1E1E;
32
+ }
33
+
34
+ @media (prefers-color-scheme: light) { :root {
35
+ --hl-0: var(--light-hl-0);
36
+ --hl-1: var(--light-hl-1);
37
+ --hl-2: var(--light-hl-2);
38
+ --hl-3: var(--light-hl-3);
39
+ --hl-4: var(--light-hl-4);
40
+ --hl-5: var(--light-hl-5);
41
+ --hl-6: var(--light-hl-6);
42
+ --hl-7: var(--light-hl-7);
43
+ --hl-8: var(--light-hl-8);
44
+ --hl-9: var(--light-hl-9);
45
+ --hl-10: var(--light-hl-10);
46
+ --hl-11: var(--light-hl-11);
47
+ --hl-12: var(--light-hl-12);
48
+ --hl-13: var(--light-hl-13);
49
+ --code-background: var(--light-code-background);
50
+ } }
51
+
52
+ @media (prefers-color-scheme: dark) { :root {
53
+ --hl-0: var(--dark-hl-0);
54
+ --hl-1: var(--dark-hl-1);
55
+ --hl-2: var(--dark-hl-2);
56
+ --hl-3: var(--dark-hl-3);
57
+ --hl-4: var(--dark-hl-4);
58
+ --hl-5: var(--dark-hl-5);
59
+ --hl-6: var(--dark-hl-6);
60
+ --hl-7: var(--dark-hl-7);
61
+ --hl-8: var(--dark-hl-8);
62
+ --hl-9: var(--dark-hl-9);
63
+ --hl-10: var(--dark-hl-10);
64
+ --hl-11: var(--dark-hl-11);
65
+ --hl-12: var(--dark-hl-12);
66
+ --hl-13: var(--dark-hl-13);
67
+ --code-background: var(--dark-code-background);
68
+ } }
69
+
70
+ :root[data-theme='light'] {
71
+ --hl-0: var(--light-hl-0);
72
+ --hl-1: var(--light-hl-1);
73
+ --hl-2: var(--light-hl-2);
74
+ --hl-3: var(--light-hl-3);
75
+ --hl-4: var(--light-hl-4);
76
+ --hl-5: var(--light-hl-5);
77
+ --hl-6: var(--light-hl-6);
78
+ --hl-7: var(--light-hl-7);
79
+ --hl-8: var(--light-hl-8);
80
+ --hl-9: var(--light-hl-9);
81
+ --hl-10: var(--light-hl-10);
82
+ --hl-11: var(--light-hl-11);
83
+ --hl-12: var(--light-hl-12);
84
+ --hl-13: var(--light-hl-13);
85
+ --code-background: var(--light-code-background);
86
+ }
87
+
88
+ :root[data-theme='dark'] {
89
+ --hl-0: var(--dark-hl-0);
90
+ --hl-1: var(--dark-hl-1);
91
+ --hl-2: var(--dark-hl-2);
92
+ --hl-3: var(--dark-hl-3);
93
+ --hl-4: var(--dark-hl-4);
94
+ --hl-5: var(--dark-hl-5);
95
+ --hl-6: var(--dark-hl-6);
96
+ --hl-7: var(--dark-hl-7);
97
+ --hl-8: var(--dark-hl-8);
98
+ --hl-9: var(--dark-hl-9);
99
+ --hl-10: var(--dark-hl-10);
100
+ --hl-11: var(--dark-hl-11);
101
+ --hl-12: var(--dark-hl-12);
102
+ --hl-13: var(--dark-hl-13);
103
+ --code-background: var(--dark-code-background);
104
+ }
105
+
106
+ .hl-0 { color: var(--hl-0); }
107
+ .hl-1 { color: var(--hl-1); }
108
+ .hl-2 { color: var(--hl-2); }
109
+ .hl-3 { color: var(--hl-3); }
110
+ .hl-4 { color: var(--hl-4); }
111
+ .hl-5 { color: var(--hl-5); }
112
+ .hl-6 { color: var(--hl-6); }
113
+ .hl-7 { color: var(--hl-7); }
114
+ .hl-8 { color: var(--hl-8); }
115
+ .hl-9 { color: var(--hl-9); }
116
+ .hl-10 { color: var(--hl-10); }
117
+ .hl-11 { color: var(--hl-11); }
118
+ .hl-12 { color: var(--hl-12); }
119
+ .hl-13 { color: var(--hl-13); }
120
+ pre, code { background: var(--code-background); }