lincd-cli 0.1.12 → 0.1.13

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 (52) hide show
  1. package/defaults/app3/package.json +2 -1
  2. package/package.json +1 -1
  3. package/defaults/app/src/App.scss +0 -3
  4. package/defaults/app/src/App.tsx +0 -5
  5. package/defaults/app/src/index.tsx +0 -10
  6. package/defaults/app/tsconfig.json +0 -18
  7. package/defaults/app2/backend/src/server.js +0 -152
  8. package/defaults/app2/backend/src/server.js.map +0 -1
  9. package/defaults/app2/backend/src/server.tsx +0 -137
  10. package/defaults/app2/frontend/src/App.js +0 -52
  11. package/defaults/app2/frontend/src/App.js.map +0 -1
  12. package/defaults/app2/frontend/src/App.tsx +0 -35
  13. package/defaults/app2/frontend/src/Html.js +0 -12
  14. package/defaults/app2/frontend/src/Html.js.map +0 -0
  15. package/defaults/app2/frontend/src/Html.tsx +0 -29
  16. package/defaults/app2/frontend/src/Layout.js +0 -153
  17. package/defaults/app2/frontend/src/Layout.js.map +0 -1
  18. package/defaults/app2/frontend/src/Layout.tsx +0 -5
  19. package/defaults/app2/frontend/src/Spinner.js +0 -9
  20. package/defaults/app2/frontend/src/Spinner.js.map +0 -0
  21. package/defaults/app2/frontend/src/Spinner.scss +0 -17
  22. package/defaults/app2/frontend/src/Spinner.tsx +0 -10
  23. package/defaults/app2/frontend/src/index.js +0 -14
  24. package/defaults/app2/frontend/src/index.js.map +0 -0
  25. package/defaults/app2/frontend/src/index.tsx +0 -16
  26. package/defaults/app2/tsconfig.json +0 -17
  27. package/defaults/app3/frontend/src/App.tsx +0 -72
  28. package/defaults/app3/frontend/src/Header.tsx +0 -16
  29. package/defaults/app3/frontend/src/Html.tsx +0 -29
  30. package/defaults/app3/frontend/src/Layout.tsx +0 -11
  31. package/defaults/app3/frontend/src/_tailwind.scss +0 -3
  32. package/defaults/app3/frontend/src/components/Spinner.scss +0 -17
  33. package/defaults/app3/frontend/src/components/Spinner.tsx +0 -10
  34. package/defaults/app3/frontend/src/index.tsx +0 -20
  35. package/defaults/app3/frontend/src/pages/Home.tsx +0 -15
  36. package/defaults/app3/frontend/src/pages/Page1.scss +0 -3
  37. package/defaults/app3/frontend/src/pages/Page1.scss.json +0 -1
  38. package/defaults/app3/frontend/src/pages/Page1.tsx +0 -15
  39. package/defaults/app3/frontend/src/pages/Page2.scss +0 -16
  40. package/defaults/app3/frontend/src/pages/Page2.scss.json +0 -1
  41. package/defaults/app3/frontend/src/pages/Page2.tsx +0 -21
  42. package/defaults/app3/tsconfig.json +0 -17
  43. package/defaults/module/Gruntfile.js +0 -16
  44. package/defaults/module/src/components/ExampleComponent.tsx +0 -20
  45. package/defaults/module/src/data/example-ontology.json +0 -20
  46. package/defaults/module/src/data/example-ontology.json.d.ts +0 -1
  47. package/defaults/module/src/index.ts +0 -7
  48. package/defaults/module/src/module.ts +0 -4
  49. package/defaults/module/src/ontologies/example-ontology.ts +0 -36
  50. package/defaults/module/src/shapes/ExampleShapeClass.ts +0 -29
  51. package/defaults/module/tsconfig-es5.json +0 -18
  52. package/defaults/module/tsconfig.json +0 -18
@@ -1,153 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const NavBar_1 = __importDefault(require("./NavBar"));
8
- const react_1 = require("react");
9
- const Sidebar_1 = __importDefault(require("./Sidebar"));
10
- const Spinner_1 = __importDefault(require("./Spinner"));
11
- const react_router_dom_1 = require("react-router-dom");
12
- const useWindowSize_1 = require("./hooks/useWindowSize");
13
- const registry_1 = require("./hooks/registry");
14
- const lincd_1 = require("lincd-modules/lib/ontologies/lincd");
15
- const rdfs_1 = require("lincd-rdfs/lib/ontologies/rdfs");
16
- const dcterms_1 = require("lincd-dcmi/lib/ontologies/dcterms");
17
- const dc_1 = require("lincd-dcmi/lib/ontologies/dc");
18
- const async_1 = __importDefault(require("react-select/async"));
19
- const Shape_1 = require("lincd/lib/shapes/Shape");
20
- const Component_1 = require("lincd-modules/lib/shapes/Component");
21
- const Module_1 = require("lincd-modules/lib/shapes/Module");
22
- const OntologyFile_1 = require("lincd-modules/lib/shapes/OntologyFile");
23
- const npm_1 = require("lincd-npm/lib/ontologies/npm");
24
- const Ontology_1 = require("lincd-owl/lib/shapes/Ontology");
25
- const react_2 = __importDefault(require("react"));
26
- class MenuOption {
27
- }
28
- function Layout({ sidebarIsOpen, setSidebarIsOpen, children }) {
29
- //sidebar will behave differently from this size, see scss
30
- let sidebarBreakpoint = 768 + 1;
31
- let adjustContentWidthBasedOnSidebar = function (width = typeof window !== 'undefined' ? window.innerWidth : undefined) {
32
- return typeof width && width > sidebarBreakpoint;
33
- };
34
- let { width } = (0, useWindowSize_1.useWindowSize)();
35
- (0, react_1.useEffect)(() => {
36
- setSidebarIsOpen(adjustContentWidthBasedOnSidebar(width));
37
- }, [width]);
38
- let navigate = (0, react_router_dom_1.useNavigate)();
39
- let processChange = debounce((value, callback) => searchRegistry(value, navigate).then((res) => callback(res)));
40
- let searchBarRef;
41
- if (!searchBarRef) {
42
- searchBarRef = react_2.default.createRef();
43
- }
44
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "wrapper landing-page", children: (0, jsx_runtime_1.jsx)("div", { className: "dashboard", children: (0, jsx_runtime_1.jsx)("header", { children: (0, jsx_runtime_1.jsxs)("div", { className: 'search-bar' + (sidebarIsOpen ? ' small' : ''), children: [(0, jsx_runtime_1.jsx)(async_1.default, { cacheOptions: true, ref: searchBarRef, id: "lincd-search", loadingMessage: (searchBar) => `Searching for '${searchBar.inputValue}'`, noOptionsMessage: (searchBar) => searchBar.inputValue.length == 0
45
- ? 'Start typing to search the registry!'
46
- : `No results found for '${searchBar.inputValue}'`, loadOptions: (searchQuery, callback) => {
47
- processChange(searchQuery, callback);
48
- }, placeholder: "Search LINCD...", onChange: (option) => {
49
- option.navigate();
50
- searchBarRef['current'].select.clearValue();
51
- }, onKeyDown: (e) => {
52
- let target = e.target;
53
- switch (e.key) {
54
- case 'Home':
55
- e.preventDefault();
56
- if (e.shiftKey) {
57
- target.selectionStart = 0;
58
- }
59
- else {
60
- target.setSelectionRange(0, 0);
61
- }
62
- break;
63
- case 'End':
64
- e.preventDefault();
65
- const len = target.value.length;
66
- if (e.shiftKey) {
67
- target.selectionEnd = len;
68
- }
69
- else {
70
- target.setSelectionRange(len, len);
71
- }
72
- break;
73
- }
74
- }, styles: {
75
- control: (provided) => ({
76
- ...provided,
77
- backgroundColor: 'rgba(0, 0, 0, 0)',
78
- borderWidth: '0',
79
- cursor: 'text',
80
- }),
81
- menu: (provided) => ({
82
- ...provided,
83
- backgroundColor: '#1e1f26',
84
- padding: '0 1% 0 0',
85
- margin: '0 1% 0 0',
86
- width: 'calc(100% - 50px)',
87
- }),
88
- input: (provided) => ({
89
- ...provided,
90
- color: 'white',
91
- }),
92
- option: (provided, state) => ({
93
- ...provided,
94
- backgroundColor: state.isSelected || state.isFocused ? '#5a5f72' : '#1e1f26',
95
- })
96
- } }), (0, jsx_runtime_1.jsx)("img", { src: "/images/search.svg", alt: "" })] }) }) }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("aside", { className: 'sidenav ' + (sidebarIsOpen ? 'active-aside' : 'closed'), children: (0, jsx_runtime_1.jsxs)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Spinner_1.default, {}), children: [(0, jsx_runtime_1.jsx)(Sidebar_1.default, { setSidebarIsOpen: setSidebarIsOpen, sidebarIsOpen: sidebarIsOpen, sidebarBreakpoint: sidebarBreakpoint }), (0, jsx_runtime_1.jsx)(NavBar_1.default, {})] }) }) }), (0, jsx_runtime_1.jsxs)("main", { style: sidebarIsOpen && adjustContentWidthBasedOnSidebar()
97
- ? {
98
- width: 'calc(100vw - 220px)', // minus sidebar
99
- }
100
- : {
101
- width: '100%',
102
- }, children: [children, (0, jsx_runtime_1.jsx)("div", { style: {
103
- display: 'flex',
104
- marginTop: '200px',
105
- }, children: (0, jsx_runtime_1.jsx)("footer", { style: { width: '100%' }, children: (0, jsx_runtime_1.jsxs)("div", { className: "container flex align-items-center ", children: [(0, jsx_runtime_1.jsxs)("a", { href: "https://twitter.com/lincd_org", target: "_blank", className: "flex align-items-center", children: [(0, jsx_runtime_1.jsx)("svg", { enableBackground: "new 0 0 56.693 56.693", height: "80px", id: "Layer_1", version: "1.1", viewBox: "0 0 56.693 56.693", width: "56.693px", xmlSpace: "preserve", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", children: (0, jsx_runtime_1.jsx)("path", { d: "M52.837,15.065c-1.811,0.805-3.76,1.348-5.805,1.591c2.088-1.25,3.689-3.23,4.444-5.592c-1.953,1.159-4.115,2-6.418,2.454 c-1.843-1.964-4.47-3.192-7.377-3.192c-5.581,0-10.106,4.525-10.106,10.107c0,0.791,0.089,1.562,0.262,2.303 c-8.4-0.422-15.848-4.445-20.833-10.56c-0.87,1.492-1.368,3.228-1.368,5.082c0,3.506,1.784,6.6,4.496,8.412 c-1.656-0.053-3.215-0.508-4.578-1.265c-0.001,0.042-0.001,0.085-0.001,0.128c0,4.896,3.484,8.98,8.108,9.91 c-0.848,0.23-1.741,0.354-2.663,0.354c-0.652,0-1.285-0.063-1.902-0.182c1.287,4.015,5.019,6.938,9.441,7.019 c-3.459,2.711-7.816,4.327-12.552,4.327c-0.815,0-1.62-0.048-2.411-0.142c4.474,2.869,9.786,4.541,15.493,4.541 c18.591,0,28.756-15.4,28.756-28.756c0-0.438-0.009-0.875-0.028-1.309C49.769,18.873,51.483,17.092,52.837,15.065z" }) }), ' ', "\u00A0 Tweet your work"] }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: "/academy", children: (0, jsx_runtime_1.jsx)("button", { className: "btn-blue-outline", children: "Join us" }) }), (0, jsx_runtime_1.jsxs)("a", { href: "https://discord.gg/2PFnf7udET", target: "_blank", className: "flex align-items-center discord-footer", children: [(0, jsx_runtime_1.jsxs)("svg", { width: "40", viewBox: "0 0 20 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip0_1892_3407)", children: (0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip1_1892_3407)", children: (0, jsx_runtime_1.jsx)("path", { d: "M16.5317 1.25625C15.2774 0.669375 13.9362 0.242861 12.534 0C12.3618 0.311339 12.1606 0.730097 12.0219 1.06322C10.5313 0.839056 9.05449 0.839056 7.59134 1.06322C7.45266 0.730097 7.24691 0.311339 7.07316 0C5.66947 0.242861 4.32673 0.670942 3.0724 1.25935C0.542395 5.08252 -0.143448 8.81073 0.199474 12.486C1.87751 13.7391 3.50372 14.5003 5.10249 14.9985C5.49724 14.4552 5.84929 13.8777 6.15259 13.269C5.57496 13.0495 5.02171 12.7787 4.49896 12.4642C4.63765 12.3615 4.7733 12.254 4.90436 12.1435C8.09276 13.6348 11.557 13.6348 14.7074 12.1435C14.84 12.254 14.9756 12.3615 15.1128 12.4642C14.5885 12.7802 14.0337 13.0511 13.4561 13.2706C13.7594 13.8777 14.1099 14.4567 14.5062 15C16.1065 14.5019 17.7342 13.7407 19.4122 12.486C19.8146 8.22542 18.7249 4.53146 16.5317 1.25625ZM6.58696 10.2257C5.62984 10.2257 4.84491 9.3322 4.84491 8.2441C4.84491 7.15599 5.61307 6.26091 6.58696 6.26091C7.56088 6.26091 8.34577 7.15442 8.32901 8.2441C8.33052 9.3322 7.56088 10.2257 6.58696 10.2257ZM13.0248 10.2257C12.0676 10.2257 11.2827 9.3322 11.2827 8.2441C11.2827 7.15599 12.0508 6.26091 13.0248 6.26091C13.9986 6.26091 14.7836 7.15442 14.7668 8.2441C14.7668 9.3322 13.9986 10.2257 13.0248 10.2257Z", fill: "white" }) }) }), (0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_1892_3407", children: (0, jsx_runtime_1.jsx)("rect", { width: "19.375", height: "15", fill: "white", transform: "translate(0.117188)" }) }), (0, jsx_runtime_1.jsx)("clipPath", { id: "clip1_1892_3407", children: (0, jsx_runtime_1.jsx)("rect", { width: "77.5", height: "15", fill: "white", transform: "translate(0.117188)" }) })] })] }), "\u00A0 Join the community"] })] }) }) })] })] }));
106
- }
107
- exports.default = Layout;
108
- function debounce(func, timeout = 700) {
109
- let timer;
110
- return (...args) => {
111
- clearTimeout(timer);
112
- timer = setTimeout(() => {
113
- func.apply(this, args);
114
- }, timeout);
115
- };
116
- }
117
- function searchRegistry(input, navigate) {
118
- let searchTypes = [lincd_1.lincd.OntologyFile, lincd_1.lincd.Module, lincd_1.lincd.Component];
119
- let results = (0, registry_1.fetchRegistry)(searchTypes, input).then(({ instances, registryURLs }) => {
120
- console.log(registryURLs, instances);
121
- return instances.map((instance) => {
122
- let option = new MenuOption();
123
- let resultShape;
124
- let resultType;
125
- option.label =
126
- instance.getValue(dc_1.dcelems.title) ||
127
- instance.getValue(dcterms_1.dcterms.title) ||
128
- instance.getValue(lincd_1.lincd.prefix) ||
129
- instance.getValue(rdfs_1.rdfs.label) ||
130
- instance.getValue(npm_1.npm.packageName) ||
131
- instance.getValue(lincd_1.lincd.npmPath);
132
- resultShape = Shape_1.Shape.getInstanceByType(instance, Module_1.Module, OntologyFile_1.OntologyFile, Component_1.Component, Ontology_1.Ontology);
133
- if (resultShape instanceof OntologyFile_1.OntologyFile) {
134
- resultType = 'Ontology';
135
- }
136
- else if (resultShape instanceof Component_1.Component) {
137
- resultType = 'Component';
138
- }
139
- else if (resultShape instanceof Module_1.Module) {
140
- resultType = 'Module';
141
- }
142
- option.navigate = () => {
143
- // Finding corresponding index of the current instance in the registryURLs
144
- // array, since they will be in the same order
145
- navigate(registryURLs[[...instances].indexOf(instance)]);
146
- };
147
- option.label = `${resultType} | ${option.label}`;
148
- return option;
149
- });
150
- });
151
- return results;
152
- }
153
- //# sourceMappingURL=Layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["Layout.tsx"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,iCAA+C;AAC/C,wDAAgC;AAChC,wDAAgC;AAChC,uDAAmD;AACnD,yDAAoD;AACpD,+CAA+C;AAC/C,8DAAyD;AACzD,yDAAoD;AACpD,+DAA0D;AAC1D,qDAAqD;AACrD,+DAA6C;AAC7C,kDAA6C;AAC7C,kEAA6D;AAC7D,4DAAuD;AACvD,wEAAmE;AACnE,sDAAiD;AACjD,4DAAuD;AACvD,kDAA0B;AAI1B,MAAM,UAAU;CAGf;AAED,SAAwB,MAAM,CAAC,EAAC,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAC;IACxE,0DAA0D;IAC1D,IAAI,iBAAiB,GAAG,GAAG,GAAG,CAAC,CAAC;IAEhC,IAAI,gCAAgC,GAAG,UACrC,KAAK,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAErE,OAAO,OAAO,KAAK,IAAI,KAAK,GAAG,iBAAiB,CAAC;IACnD,CAAC,CAAC;IAEF,IAAI,EAAC,KAAK,EAAC,GAAG,IAAA,6BAAa,GAAE,CAAC;IAC9B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,gCAAgC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAI,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAE7B,IAAI,aAAa,GAAG,QAAQ,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GA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YACjD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
-
3
- export default function Layout({children}) {
4
- return <main>{children}</main>;
5
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- require("./Spinner.scss");
5
- function Spinner({ active = true }) {
6
- return ((0, jsx_runtime_1.jsx)("div", { className: ['spinner', active && 'spinner--active'].join(' '), role: "progressbar", "aria-busy": active ? 'true' : 'false' }));
7
- }
8
- exports.default = Spinner;
9
- //# sourceMappingURL=Spinner.js.map
File without changes
@@ -1,17 +0,0 @@
1
-
2
- .spinner.spinner--active {
3
- border: 4px solid #474545;
4
- border-top: 4px solid lightblue;
5
- border-radius: 50%;
6
- width: 24px;
7
- height: 24px;
8
- animation: spin 1s linear infinite;
9
- }
10
- @keyframes spin {
11
- 0% {
12
- transform: rotate(0deg);
13
- }
14
- 100% {
15
- transform: rotate(360deg);
16
- }
17
- }
@@ -1,10 +0,0 @@
1
- import './Spinner.scss';
2
- export default function Spinner({active = true}) {
3
- return (
4
- <div
5
- className={['spinner', active && 'spinner--active'].join(' ')}
6
- role="progressbar"
7
- aria-busy={active ? 'true' : 'false'}
8
- />
9
- );
10
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const client_1 = require("react-dom/client");
8
- const react_router_dom_1 = require("react-router-dom");
9
- const App_1 = __importDefault(require("./App"));
10
- const react_1 = __importDefault(require("react")); //we mostly use scss files, but we support tailwind as well for some components
11
- // import './scss/_tailwind.scss';
12
- require("./scss/main.scss");
13
- (0, client_1.hydrateRoot)(document, (0, jsx_runtime_1.jsx)(react_1.default.StrictMode, { children: (0, jsx_runtime_1.jsx)(react_router_dom_1.BrowserRouter, { children: (0, jsx_runtime_1.jsx)(App_1.default, { assets: window['assetManifest'] }) }) }));
14
- //# sourceMappingURL=index.js.map
File without changes
@@ -1,16 +0,0 @@
1
- import {hydrateRoot} from 'react-dom/client';
2
- import {BrowserRouter} from 'react-router-dom';
3
- import App from './App';
4
- import React from 'react';
5
-
6
- //uncomment if you want to use tailwind
7
- // import './scss/_tailwind.scss';
8
-
9
- hydrateRoot(
10
- document,
11
- <React.StrictMode>
12
- <BrowserRouter>
13
- <App assets={window['assetManifest']} />
14
- </BrowserRouter>
15
- </React.StrictMode>,
16
- );
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "moduleResolution": "node",
5
- "sourceMap": true,
6
- "target": "es2019",
7
- "declaration": false,
8
- "experimentalDecorators": true,
9
- "emitDecoratorMetadata": true,
10
- "esModuleInterop": true,
11
- "resolveJsonModule": true,
12
- "jsx": "react-jsx",
13
- "types": ["node", "react", "react-dom"],
14
- "pretty": true
15
- },
16
- "files": ["./frontend/src/index.tsx", "./backend/src/server.ts"]
17
- }
@@ -1,72 +0,0 @@
1
- import {lazy, Suspense} from 'react';
2
- import {ErrorBoundary} from 'react-error-boundary';
3
- import Html from './Html';
4
- import Spinner from './components/Spinner';
5
- import Layout from './Layout';
6
- import {Route, Routes} from 'react-router-dom';
7
- import {Storage} from 'lincd/lib/utils/Storage';
8
- import {FrontendFileStore} from 'lincd-server/lib/shapes/FrontendFileStore';
9
-
10
- const Home = lazy(() => import('./pages/Home' /* webpackPrefetch: true */));
11
- const Page1 = lazy(() => import('./pages/Page1' /* webpackPrefetch: true */));
12
- const Page2 = lazy(() => import('./pages/Page2' /* webpackPrefetch: true */));
13
-
14
- let store = new FrontendFileStore('main');
15
- Storage.setDefaultStore(store);
16
-
17
- declare var window;
18
- export default function App({assets = typeof window !== 'undefined' ? window['assetManifest'] : {}}) {
19
- return (
20
- <Html assets={assets} title="${name} - LINCD App">
21
- <Suspense fallback={<Spinner />}>
22
- <ErrorBoundary FallbackComponent={Error}>
23
- <Content />
24
- </ErrorBoundary>
25
- </Suspense>
26
- </Html>
27
- );
28
- }
29
-
30
- function Content() {
31
- return (
32
- <Layout>
33
- <div className="p-4 w-2/3 m-auto bg-gray-100 shadow-gray-300 shadow">
34
- <Routes>
35
- <Route
36
- path="/"
37
- element={
38
- <Suspense fallback={<Spinner />}>
39
- <Home />
40
- </Suspense>
41
- }
42
- />
43
- <Route
44
- path="/page1"
45
- element={
46
- <Suspense fallback={<Spinner />}>
47
- <Page1 />
48
- </Suspense>
49
- }
50
- />
51
- <Route
52
- path="/page2"
53
- element={
54
- <Suspense fallback={<Spinner />}>
55
- <Page2 />
56
- </Suspense>
57
- }
58
- />
59
- </Routes>
60
- </div>
61
- </Layout>
62
- );
63
- }
64
-
65
- function Error({error}) {
66
- return (
67
- <div style={{color: 'white', margin: '2rem'}}>
68
- <h1>Application Error</h1>
69
- <pre style={{whiteSpace: 'pre-wrap', padding: '1rem'}}>{error.stack}</pre>
70
- </div>
71
- );
72
- }
@@ -1,16 +0,0 @@
1
- import {Link} from 'react-router-dom';
2
- import React from 'react';
3
-
4
- export function Header()
5
- {
6
- return (
7
- <header className="w-2/3 m-auto">
8
- <h1 className="font-xl font-bold">${name}</h1>
9
- <nav className="my-4 grid grid-cols-6 gap-4">
10
- <Link to="/">Home</Link>
11
- <Link to="/page1">Page 1</Link>
12
- <Link to="/page2">Page 2</Link>
13
- </nav>
14
- </header>
15
- );
16
- }
@@ -1,29 +0,0 @@
1
- export default function Html({assets, children, title}) {
2
- return (
3
- <html lang="en">
4
- <head>
5
- <meta charSet="utf-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <link rel="shortcut icon" href="/static/favicon.ico" />
8
- <link rel="stylesheet" href={assets['main.css']} />
9
- {assets['tailwind-cdn'] && (
10
- <script src={assets['tailwind-cdn']}></script>
11
- )}
12
- <title>{title}</title>
13
- </head>
14
- <body>
15
- <noscript
16
- dangerouslySetInnerHTML={{
17
- __html: `<b>Enable JavaScript to run this app.</b>`,
18
- }}
19
- />
20
- {children}
21
- <script
22
- dangerouslySetInnerHTML={{
23
- __html: `assetManifest = ${JSON.stringify(assets)};`,
24
- }}
25
- />
26
- </body>
27
- </html>
28
- );
29
- }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import {Header} from './Header';
3
-
4
- export default function Layout({children}) {
5
- return (
6
- <main className="m-8 font-sans">
7
- <Header />
8
- {children}
9
- </main>
10
- );
11
- }
@@ -1,3 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
@@ -1,17 +0,0 @@
1
-
2
- .spinner.spinner--active {
3
- border: 4px solid #474545;
4
- border-top: 4px solid lightblue;
5
- border-radius: 50%;
6
- width: 24px;
7
- height: 24px;
8
- animation: spin 1s linear infinite;
9
- }
10
- @keyframes spin {
11
- 0% {
12
- transform: rotate(0deg);
13
- }
14
- 100% {
15
- transform: rotate(360deg);
16
- }
17
- }
@@ -1,10 +0,0 @@
1
- import './Spinner.scss';
2
- export default function Spinner({active = true}) {
3
- return (
4
- <div
5
- className={['spinner', active && 'spinner--active'].join(' ')}
6
- role="progressbar"
7
- aria-busy={active ? 'true' : 'false'}
8
- />
9
- );
10
- }
@@ -1,20 +0,0 @@
1
- window['$RefreshReg$'] = () => {};
2
- window['$RefreshSig$'] = () => () => {};
3
-
4
- import {hydrateRoot} from 'react-dom/client';
5
- import {BrowserRouter} from 'react-router-dom';
6
- import App from './App';
7
- import React from 'react';
8
-
9
- //comment out if you don't want to use tailwind
10
- import './_tailwind.scss';
11
-
12
-
13
- hydrateRoot(
14
- document,
15
- <React.StrictMode>
16
- <BrowserRouter>
17
- <App assets={window['assetManifest']} />
18
- </BrowserRouter>
19
- </React.StrictMode>,
20
- );
@@ -1,15 +0,0 @@
1
- export default function Home() {
2
- return (
3
- <div>
4
- <h1 className="my-2 text-xl font-bold">${name}</h1>
5
- <h2 className="my-2 text-lg font-bold">Get started</h2>
6
- <p>
7
- Your LINCD App is ready to go!<br />
8
- To edit this file, open:
9
- </p>
10
- <code className="font-mono my-2 bg-blue-100 p-2 block">
11
- <pre>/frontend/src/pages/Home.tsx</pre>
12
- </code>
13
- </div>
14
- );
15
- }
@@ -1,3 +0,0 @@
1
- .page1 {
2
- display:block;
3
- }
@@ -1 +0,0 @@
1
- {"page1":"test_app_123_Page1_page1"}
@@ -1,15 +0,0 @@
1
- import "./Page1.scss";
2
- export default function Page1() {
3
- return (
4
- <div className="page1">
5
- This page is styled with SASS. Simply import the relevant .scss file in your code to include it in the bundle.
6
- Using this setup, class names will have a global scope.<br />
7
- <br />
8
- See:
9
- <code className="font-mono my-2 bg-blue-100 p-2 block">
10
- <pre>/frontend/src/pages/Page1.tsx</pre>
11
- </code>
12
-
13
- </div>
14
- );
15
- }
@@ -1,16 +0,0 @@
1
- .page2 {
2
- display:block;
3
- span {
4
- font-style:italic;
5
- }
6
- h1 {
7
- font-size:1.5rem;
8
- }
9
- code {
10
- font-family: monospace;
11
- margin: 0.5rem 0;
12
- background-color:lightcyan;
13
- padding: 0.5rem;
14
- display:block;
15
- }
16
- }
@@ -1 +0,0 @@
1
- {"page2":"test_app_123_Page2_page2"}
@@ -1,21 +0,0 @@
1
- import "./Page2.scss";
2
- import * as style from "./Page2.scss.json";
3
- export default function Page2() {
4
- return (
5
- <div className={style.page2}>
6
- <h1>Example page using SASS + CSS Modules</h1>
7
- This page is styled with SASS + CSS Modules. It imports the relevant .scss file{' '}
8
- <span>and the generated .scss.json file</span>.<br />
9
- <br />
10
- Using this setup your class names will be scoped to the file(s)
11
- where you use them. The typescript compiler will also auto complete class names and warn you if you're using class
12
- names that don't exists.
13
- <br />
14
- <br />
15
- See:
16
- <code>
17
- <pre>/frontend/src/pages/Page2.tsx</pre>
18
- </code>
19
- </div>
20
- );
21
- }
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "moduleResolution": "node",
5
- "sourceMap": true,
6
- "target": "es2019",
7
- "declaration": false,
8
- "experimentalDecorators": true,
9
- "emitDecoratorMetadata": true,
10
- "esModuleInterop": true,
11
- "resolveJsonModule": true,
12
- "jsx": "react-jsx",
13
- "types": ["node", "react", "react-dom"],
14
- "pretty": true
15
- },
16
- "files": ["./frontend/src/index.tsx"]
17
- }
@@ -1,16 +0,0 @@
1
- var buildTools = require('lincd-cli');
2
- module.exports = buildTools.generateGruntConfig('${module_name}', {
3
- externals: {
4
- react: 'React',
5
- 'react-dom': 'ReactDOM',
6
- }, //list of non lincd modules that are already loaded and made globally available by one of the dependencies of this module
7
- //internals: [],//list of lincd modules that you want to INCLUDE in the bundle (as opposed to the module its own bundle being a dependency)
8
- //alias:{},//webpack alias -> maps on type of npm path to another
9
- //target:"es5"|"es6",
10
- //environment:"server"|"frontend",
11
- //outputPath:string,
12
- //es5Server:boolean
13
- //es5:{},//es5 specific config, use same properties as above
14
- //es6:{},//es6 specific config, use same properties as above
15
- //debug:false,//debug the build process
16
- });
@@ -1,20 +0,0 @@
1
- import React from "react";
2
- import {ExampleShapeClass} from "../shapes/ExampleShapeClass";
3
- import {linkedComponentClass,linkedComponent} from '../module';
4
- import {LinkedComponentClass} from 'lincd/lib/utils/LinkedComponentClass';
5
-
6
- export const ExampleComponent = linkedComponent<ExampleShapeClass>(ExampleShapeClass, ({source, sourceShape}) => {
7
- //note that typescript knows that person has the type of the Shape you provided
8
- return <div></div>;
9
- });
10
-
11
- //alternatively, use a Class component if you prefer:
12
- /*@linkedComponentClass(ExampleShapeClass)
13
- export class ExampleComponent extends LinkedComponentClass<ExampleShapeClass> {
14
- render() {
15
- let exampleInstance = this.sourceShape;
16
-
17
- //get the name of this item from the graph
18
- return <h1>Hello {exampleInstance.name}!</h1>;
19
- }
20
- }*/
@@ -1,20 +0,0 @@
1
- {
2
- "@context": {
3
- "dc": "http://purl.org/dc/elements/1.1/",
4
- "owl": "http://www.w3.org/2002/07/owl#",
5
- "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
6
- "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
7
- "${hyphen_name}": "${uri_base}"
8
- },
9
- "@graph": [
10
- {
11
- "@id": "${hyphen_name}:ExampleClass",
12
- "@type": "rdfs:Class",
13
- "rdfs:comment": "This is an example class. You can remove or rename it",
14
- "rdfs:isDefinedBy": {
15
- "@id": "${hyphen_name}:"
16
- },
17
- "rdfs:label": "Example Class"
18
- }
19
- ]
20
- }
@@ -1 +0,0 @@
1
- export var json: string;
@@ -1,7 +0,0 @@
1
- import './ontologies/${hyphen_name}';
2
-
3
- //SHAPES FIRST
4
- import './shapes/ExampleShapeClass';
5
-
6
- //THEN COMPONENTS
7
- import './components/ExampleComponent';