@moneko/solid 1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Moneko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @moneko/solid
2
+
3
+ > solid JS
package/base.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "downlevelIteration": true,
4
+ "jsx": "preserve",
5
+ "jsxImportSource": "solid-js",
6
+ "isolatedModules": true,
7
+ "strict": true,
8
+ "noUnusedLocals": true,
9
+ "noUnusedParameters": true,
10
+ "noImplicitReturns": true,
11
+ "noFallthroughCasesInSwitch": true,
12
+ "moduleResolution": "node",
13
+ "esModuleInterop": true,
14
+ "resolveJsonModule": true,
15
+ "experimentalDecorators": true,
16
+ "emitDecoratorMetadata": true,
17
+ "forceConsistentCasingInFileNames": true,
18
+ "skipLibCheck": true,
19
+ "target": "ESNext",
20
+ "module": "ESNext",
21
+ "declaration": true,
22
+ "emitDeclarationOnly": true,
23
+ "removeComments": false,
24
+ "preserveConstEnums": true,
25
+ "sourceMap": false,
26
+ "newLine": "lf",
27
+ "listEmittedFiles": false,
28
+ "listFiles": false,
29
+ "noImplicitAny": true,
30
+ "noImplicitThis": true,
31
+ "alwaysStrict": true,
32
+ "traceResolution": false
33
+ }
34
+ }
package/env.d.ts ADDED
@@ -0,0 +1,224 @@
1
+ declare module '*.less';
2
+ declare module '*.css';
3
+ declare module '*.js';
4
+ declare module '*.jsx';
5
+ declare module '*.cjs';
6
+ declare module '*.mjs';
7
+ declare module '*.json';
8
+ declare module '*.ts';
9
+ declare module '*.png';
10
+ declare module '*.svg';
11
+ declare module '*.woff2';
12
+ declare module './index.less' {
13
+ const styles: { readonly [key: string]: string };
14
+
15
+ export default styles;
16
+ }
17
+
18
+ declare module '*.mdx' {
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ let MDXComponent: (props: any) => JSX.Element;
21
+
22
+ export default MDXComponent;
23
+ }
24
+
25
+ declare module '*?raw' {
26
+ export default string;
27
+ }
28
+ declare module '@app/docs' {
29
+ import { JSX } from 'solid-js';
30
+
31
+ interface ApiEntry {
32
+ [key: string]: (() => JSX.Element)[];
33
+ }
34
+ const entry: ApiEntry;
35
+
36
+ export default entry;
37
+ }
38
+ declare module '@app' {
39
+ interface App {
40
+ /** 应用名称 */
41
+ name: string;
42
+ /** 应用描述 */
43
+ description: string;
44
+ /** 应用版本 */
45
+ version: string;
46
+ /** 应用类型 */
47
+ type: 'single-component' | 'mobile' | 'site' | 'back-stage' | 'single-spa' | 'library';
48
+ /** 开发者 */
49
+ author: {
50
+ name: string;
51
+ url?: string;
52
+ email?: string;
53
+ };
54
+ /** 存储库 */
55
+ repository: {
56
+ type?: string;
57
+ url?: string;
58
+ directory?: string;
59
+ };
60
+ /** 路由模式 */
61
+ routerMode: 'hash' | 'browser' | 'memory';
62
+ /** 根路由 */
63
+ base: string;
64
+ /** 设计尺寸 */
65
+ designSize: number;
66
+ /** 本地化 */
67
+ locales: boolean;
68
+ /** 渲染模式 */
69
+ mode: 'ssr' | 'csr';
70
+ }
71
+ const app: App;
72
+
73
+ export default app;
74
+ }
75
+ declare module '@app/routes' {
76
+ import { RouteDefinition } from '@solidjs/router';
77
+ interface IRouteDefinition extends Omit<RouteDefinition, 'children'> {
78
+ children?: RouteConfig[];
79
+ }
80
+
81
+ export interface RouteConfig extends IRouteDefinition {
82
+ /** 菜单id */
83
+ key?: string;
84
+ path: string;
85
+ /** 菜单图标 */
86
+ icon?: string;
87
+ dynamicTitle?: string;
88
+ /** 菜单名 */
89
+ label?: string | null;
90
+ hideMenu?: boolean;
91
+ hideTab?: boolean;
92
+ onlyLogin?: boolean;
93
+ /** 菜单父id */
94
+ parentId?: string;
95
+ /** 可否关闭标签 */
96
+ closable?: boolean;
97
+ /** 子菜单 */
98
+ // children?: RouterProps[];
99
+ props?: {
100
+ path: string;
101
+ [key: string]: Any;
102
+ };
103
+ meta?: Record<string, string | number | boolean>;
104
+ }
105
+ const routes: RouteConfig[];
106
+
107
+ export default routes;
108
+ }
109
+ declare module '@app/example' {
110
+ export interface ExampleModule {
111
+ codes: Record<string, string>;
112
+ title?: string;
113
+ description?: string;
114
+ col?: string;
115
+ order?: number;
116
+ [key: string]: unknown;
117
+ }
118
+ const example: Record<string, ExampleModule[]>;
119
+
120
+ export default example;
121
+ }
122
+ declare module '@app/coverage' {
123
+ export type CoverageType = {
124
+ /** 语句(statement coverage) */
125
+ statements: string;
126
+ /** 语句覆盖: 是不是每个语句都执行了 */
127
+ coveredstatements: string;
128
+ /** 条件(branch coverage) */
129
+ conditionals: string;
130
+ /** 条件覆盖: 是不是每个条件代码块都执行了 */
131
+ coveredconditionals: string;
132
+ /** 函数(function coverage) */
133
+ methods: string;
134
+ /** 函数覆盖: 是不是每个函数都调用了 */
135
+ coveredmethods: string;
136
+ };
137
+ export type ProjectCoverageType = {
138
+ /** 元素 */
139
+ elements: string;
140
+ /** 覆盖元素 */
141
+ coveredelements: string;
142
+ complexity: string;
143
+ loc: string;
144
+ ncloc: string;
145
+ /** 经过测试的组件 */
146
+ packages: string;
147
+ /** 经过测试的文件 */
148
+ files: string;
149
+ /** 经过测试的类 */
150
+ classes: string;
151
+ };
152
+ const coverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;
153
+
154
+ export default coverage;
155
+ }
156
+ declare module '@app/fallback' {
157
+ import { JSX } from 'solid-js';
158
+ const Fallback: null | (() => JSX.Element);
159
+
160
+ export default Fallback;
161
+ }
162
+
163
+ declare let __webpack_public_path__: string | undefined;
164
+
165
+ interface Window {
166
+ areaPaddingTop?: number;
167
+ areaPaddingBottom?: number;
168
+ }
169
+ interface ICustomElement {
170
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
+ [prop: string]: any;
172
+ __initialized?: boolean;
173
+ __released: boolean;
174
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
175
+ __releaseCallbacks: any[];
176
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
177
+ __propertyChangedCallbacks: any[];
178
+ __updating: {
179
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
180
+ [prop: string]: any;
181
+ };
182
+ props: {
183
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
184
+ [prop: string]: any;
185
+ };
186
+ lookupProp(attrName: string): string | undefined;
187
+ renderRoot: Element | Document | ShadowRoot | DocumentFragment;
188
+ addReleaseCallback(fn: () => void): void;
189
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
190
+ addPropertyChangedCallback(fn: (name: string, value: any) => void): void;
191
+ }
192
+ type IEvent<T> = (e: CustomEvent<T>) => void;
193
+ type ICustomEvent<T, K extends keyof T> = T extends { [key in K]?: (v: infer V) => void }
194
+ ? IEvent<V>
195
+ : T extends { [key in K]?: (...args: infer Args) => void }
196
+ ? IEvent<Args>
197
+ : never;
198
+
199
+ type IOmit<T, Keys extends keyof T> = Omit<T, Keys> & {
200
+ [K in Keys]?: ICustomEvent<T, K>;
201
+ };
202
+
203
+ type CustomElement<T extends Partial<ICustomElement> = ICustomElement> = IOmit<
204
+ T,
205
+ | 'onChange'
206
+ | 'onOpenChange'
207
+ | 'onErrorRecorder'
208
+ | 'onStopRecorder'
209
+ | 'onStartRecorder'
210
+ | 'onRecorderDataAvailable'
211
+ | 'onErrorCapture'
212
+ | 'onStopCapture'
213
+ | 'onStartCapture'
214
+ | 'onSaveRecorder'
215
+ > & {
216
+ ref?: CustomElement<T> | { current: CustomElement<T> | null };
217
+ shadowRoot?: ShadowRoot | Element | null;
218
+ offsetWidth?: number;
219
+ part?: string;
220
+ };
221
+
222
+ interface ComponentOptions<T> {
223
+ element: T & ICustomElement;
224
+ }
package/jest-preset.js ADDED
@@ -0,0 +1,84 @@
1
+ const name = process.env.npm_package_name;
2
+
3
+ export default {
4
+ coverageDirectory: "coverage",
5
+ testEnvironment: "jsdom",
6
+ roots: ["components"],
7
+ moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
8
+ testMatch: ["<rootDir>/components/**/__tests__/**/*.{js,jsx,ts,tsx}"],
9
+ coveragePathIgnorePatterns: [
10
+ "<rootDir>/test/",
11
+ "<rootDir>/lib/",
12
+ "<rootDir>/es/",
13
+ "<rootDir>/docs/",
14
+ "<rootDir>/node_modules/",
15
+ ],
16
+ testPathIgnorePatterns: [
17
+ "<rootDir>/test/",
18
+ "<rootDir>/lib/",
19
+ "<rootDir>/es/",
20
+ "<rootDir>/docs/",
21
+ "<rootDir>/node_modules/",
22
+ ],
23
+ transformIgnorePatterns: [
24
+ "<rootDir>/lib/",
25
+ "<rootDir>/es/",
26
+ "<rootDir>/docs/",
27
+ ],
28
+ moduleNameMapper: {
29
+ [name]: "<rootDir>/components/index.ts",
30
+ },
31
+ transform: {
32
+ "^.+\\.(t|j)sx?$": [
33
+ "@swc/jest",
34
+ {
35
+ module: {
36
+ type: "es6",
37
+ },
38
+ jsc: {
39
+ parser: {
40
+ syntax: "typescript",
41
+ decorators: true,
42
+ dynamicImport: true,
43
+ tsx: true,
44
+ },
45
+ target: "es2022",
46
+ transform: {
47
+ legacyDecorator: true,
48
+ decoratorMetadata: true,
49
+ react: {
50
+ refresh: false,
51
+ importSource: "solid-js/h",
52
+ },
53
+ },
54
+ experimental: {
55
+ plugins: [
56
+ [
57
+ "@moneko/jsx-dom-expressions",
58
+ {
59
+ moduleName: "solid-js/web",
60
+ builtIns: [
61
+ "For",
62
+ "Show",
63
+ "Switch",
64
+ "Match",
65
+ "Suspense",
66
+ "SuspenseList",
67
+ "Portal",
68
+ "Index",
69
+ "Dynamic",
70
+ "ErrorBoundary",
71
+ ],
72
+ contextToCustomElements: true,
73
+ wrapConditionals: true,
74
+ generate: "dom",
75
+ hydratable: false,
76
+ },
77
+ ],
78
+ ],
79
+ },
80
+ },
81
+ },
82
+ ],
83
+ },
84
+ };
package/lib/entry.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/lib/entry.js ADDED
@@ -0,0 +1,2 @@
1
+ import{createComponent as r}from"solid-js/web";import{Router as e,useRoutes as o}from"@solidjs/router";import{createRoot as t,getOwner as m}from"solid-js";import{render as i}from"solid-js/web";import p from"@app";import s from"@app/routes";t(()=>{let t=document.getElementById("root");t.replaceChildren(),i(function(){let t=o(s);return r(e,{get base(){return p.base},get children(){return r(t,{})}})},t)},m());
2
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/entry.tsx"],"sourcesContent":["import { type RouteDefinition, Router, useRoutes } from '@solidjs/router';\nimport { createRoot, getOwner } from 'solid-js';\nimport { render } from 'solid-js/web';\nimport app from '@app';\nimport routeDefinition from '@app/routes';\n\ncreateRoot(() => {\n const root = document.getElementById('root') as HTMLElement;\n\n function App() {\n const Routes = useRoutes(routeDefinition as RouteDefinition[]);\n\n return (\n <Router base={app.base}>\n <Routes />\n </Router>\n );\n }\n root.replaceChildren();\n render(App, root);\n}, getOwner());\n"],"names":["Router","useRoutes","createRoot","getOwner","render","app","routeDefinition","root","document","getElementById","replaceChildren","Routes","base"],"mappings":"8CAAA,QAA+BA,UAAAA,CAAM,CAAEC,aAAAA,CAAS,KAAQ,iBAAkB,AAC1E,QAASC,cAAAA,CAAU,CAAEC,YAAAA,CAAQ,KAAQ,UAAW,AAChD,QAASC,UAAAA,CAAM,KAAQ,cAAe,AACtC,QAAOC,MAAS,MAAO,AACvB,QAAOC,MAAqB,aAAc,CAE1CJ,EAAW,KACT,IAAMK,EAAOC,SAASC,eAAe,QAWrCF,EAAKG,kBACLN,EAVA,WACE,IAAMO,EAASV,EAAUK,GAEzB,SACGN,qBAAaK,EAAIO,8BACfD,QAGP,EAEYJ,EACd,EAAGJ"}
@@ -0,0 +1,3 @@
1
+ import { type Location } from '@solidjs/router';
2
+ declare function getPathName(location: Location): string;
3
+ export default getPathName;
@@ -0,0 +1,2 @@
1
+ import t from"@app";let e=t.base.length,n=e>1?t.base.endsWith("/")?e:e+1:e;export default function(t){return t.pathname.substring(n)};
2
+ //# sourceMappingURL=get-pathname.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/get-pathname.ts"],"sourcesContent":["import { type Location } from '@solidjs/router';\nimport app from '@app';\n\nconst len = app.base.length;\nconst prefix = len > 1 ? (app.base.endsWith('/') ? len : len + 1) : len;\n\nfunction getPathName(location: Location) {\n return location.pathname.substring(prefix);\n}\n\nexport default getPathName;\n"],"names":["app","len","base","length","prefix","endsWith","location","pathname","substring"],"mappings":"AACA,OAAOA,MAAS,MAAO,CAEvB,IAAMC,EAAMD,EAAIE,KAAKC,OACfC,EAASH,EAAM,EAAKD,EAAIE,KAAKG,SAAS,KAAOJ,EAAMA,EAAM,EAAKA,CAMpE,gBAJA,SAAqBK,CAAkB,EACrC,OAAOA,EAASC,SAASC,UAAUJ,EACrC,CAE2B"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from '@solidjs/router';
2
+ export { default as getPathName } from './get-pathname.js';
3
+ export { default as SuspenseComp } from './suspense-comp.js';
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export*from"@solidjs/router";export{default as getPathName}from"./get-pathname.js";export{default as SuspenseComp}from"./suspense-comp.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from '@solidjs/router';\nexport { default as getPathName } from './get-pathname.js';\nexport { default as SuspenseComp } from './suspense-comp.js';\n"],"names":["default","getPathName","SuspenseComp"],"mappings":"AAAA,WAAc,iBAAkB,AAChC,QAASA,WAAWC,WAAW,KAAQ,mBAAoB,AAC3D,QAASD,WAAWE,YAAY,KAAQ,oBAAqB"}
package/lib/merge.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare function merge<T extends object & {
2
+ children?: T[];
3
+ meta?: object;
4
+ }>(route: T[], key: keyof T): T[] | undefined;
5
+ export default merge;
package/lib/merge.js ADDED
@@ -0,0 +1,2 @@
1
+ export default function e(n,r){if(!n.length)return;let t=[];return n.forEach(n=>{let i=t.findIndex(e=>e[r]==n[r]);if(i>-1){let l=[...t[i].children||[],...n.children||[]];t[i]=Object.assign(n,t[i],t[i].meta&&{meta:{...t[i].meta,...n.meta}}),l.length&&(t[i].children=e(l,r))}else t.push(Object.assign(n,Array.isArray(n.children)&&{children:e(n.children,r)}))}),t};
2
+ //# sourceMappingURL=merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/merge.ts"],"sourcesContent":["function merge<T extends object & { children?: T[]; meta?: object }>(route: T[], key: keyof T) {\n if (!route.length) return void 0;\n const arr: T[] = [];\n\n route.forEach((e) => {\n const idx = arr.findIndex((i) => i[key] == e[key]);\n\n if (idx > -1) {\n const ctree = [...(arr[idx].children || []), ...(e.children || [])];\n\n arr[idx] = Object.assign(\n e,\n arr[idx],\n arr[idx].meta && {\n meta: {\n ...arr[idx].meta,\n ...e.meta,\n },\n },\n );\n if (ctree.length) {\n arr[idx].children = merge(ctree, key);\n }\n } else {\n arr.push(\n Object.assign(\n e,\n Array.isArray(e.children) && {\n children: merge(e.children, key),\n },\n ),\n );\n }\n });\n\n return arr;\n}\n\nexport default merge;\n"],"names":["merge","route","key","length","arr","forEach","e","idx","findIndex","i","ctree","children","Object","assign","meta","push","Array","isArray"],"mappings":"AAsCA,eAtCA,SAASA,EAA4DC,CAAU,CAAEC,CAAY,EAC3F,GAAI,CAACD,EAAME,OAAQ,OACnB,IAAMC,EAAW,EAAE,CAiCnB,OA/BAH,EAAMI,QAAQ,AAACC,IACb,IAAMC,EAAMH,EAAII,UAAU,AAACC,GAAMA,CAAC,CAACP,EAAI,EAAII,CAAC,CAACJ,EAAI,EAEjD,GAAIK,EAAM,GAAI,CACZ,IAAMG,EAAQ,IAAKN,CAAG,CAACG,EAAI,CAACI,UAAY,EAAE,IAAOL,EAAEK,UAAY,EAAE,CAAE,AAEnEP,CAAAA,CAAG,CAACG,EAAI,CAAGK,OAAOC,OAChBP,EACAF,CAAG,CAACG,EAAI,CACRH,CAAG,CAACG,EAAI,CAACO,MAAQ,CACfA,KAAM,CACJ,GAAGV,CAAG,CAACG,EAAI,CAACO,IAAI,CAChB,GAAGR,EAAEQ,IAAI,AACX,CACF,GAEEJ,EAAMP,QACRC,CAAAA,CAAG,CAACG,EAAI,CAACI,SAAWX,EAAMU,EAAOR,EAAG,CAExC,MACEE,EAAIW,KACFH,OAAOC,OACLP,EACAU,MAAMC,QAAQX,EAAEK,WAAa,CAC3BA,SAAUX,EAAMM,EAAEK,SAAUT,EAC9B,GAIR,GAEOE,CACT,CAEqB"}
@@ -0,0 +1,252 @@
1
+ html,
2
+ body {
3
+ margin: 0;
4
+ padding: 0;
5
+ inline-size: 100vi;
6
+ font-size: 14px;
7
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
8
+ Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
9
+ 'Noto Color Emoji', Helvetica, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans';
10
+ color: var(--text-color, rgb(0 0 0 / 65%));
11
+ line-height: 1.8;
12
+ transition-duration: 0.3s;
13
+ transition-property: background-color, color;
14
+ transition-timing-function: cubic-bezier(0.94, -0.1, 0.1, 1.2);
15
+ }
16
+
17
+ #root {
18
+ display: flex;
19
+ -webkit-overflow-scrolling: touch;
20
+ }
21
+
22
+ #root > main {
23
+ animation: route-in var(--transition-duration, 0.3s);
24
+ }
25
+
26
+ input,
27
+ textarea {
28
+ caret-color: inherit;
29
+ }
30
+
31
+ h1 {
32
+ margin: 0.67em 0;
33
+ font-size: 2em;
34
+ }
35
+
36
+ hr {
37
+ overflow: visible;
38
+ block-size: 0;
39
+ box-sizing: content-box;
40
+ }
41
+
42
+ pre {
43
+ font-size: 1em;
44
+ font-family: monospace;
45
+ }
46
+
47
+ a {
48
+ text-decoration: none;
49
+ background-color: transparent;
50
+ cursor: pointer;
51
+ }
52
+
53
+ abbr[title] {
54
+ border-block-end: none;
55
+ text-decoration: underline;
56
+ text-decoration: underline dotted;
57
+ }
58
+
59
+ b,
60
+ strong {
61
+ font-weight: bolder;
62
+ }
63
+
64
+ code,
65
+ kbd,
66
+ samp {
67
+ font-size: 1em;
68
+ font-family: monospace;
69
+ }
70
+
71
+ small {
72
+ font-size: 80%;
73
+ }
74
+
75
+ sub,
76
+ sup {
77
+ position: relative;
78
+ font-size: 75%;
79
+ line-height: 0;
80
+ vertical-align: baseline;
81
+ }
82
+
83
+ sub {
84
+ inset-block-end: -0.25em;
85
+ }
86
+
87
+ sup {
88
+ inset-block-start: -0.5em;
89
+ }
90
+
91
+ img {
92
+ border-style: none;
93
+ }
94
+
95
+ img,
96
+ button {
97
+ outline: 1px solid transparent;
98
+ }
99
+
100
+ button,
101
+ input,
102
+ optgroup,
103
+ select,
104
+ textarea {
105
+ margin: 0;
106
+ font-size: 100%;
107
+ font-family: inherit;
108
+ line-height: 1.15;
109
+ }
110
+
111
+ button,
112
+ input {
113
+ overflow: visible;
114
+ }
115
+
116
+ button,
117
+ select {
118
+ text-transform: none;
119
+ }
120
+
121
+ button,
122
+ [type='button'],
123
+ [type='reset'],
124
+ [type='submit'] {
125
+ appearance: button;
126
+ }
127
+
128
+ button::-moz-focus-inner,
129
+ [type='button']::-moz-focus-inner,
130
+ [type='reset']::-moz-focus-inner,
131
+ [type='submit']::-moz-focus-inner {
132
+ border-style: none;
133
+ padding: 0;
134
+ }
135
+
136
+ button:-moz-focusring,
137
+ [type='button']:-moz-focusring,
138
+ [type='reset']:-moz-focusring,
139
+ [type='submit']:-moz-focusring {
140
+ outline: 1px dotted var(--primary-outline);
141
+ }
142
+
143
+ fieldset {
144
+ padding: 0.35em 0.75em 0.625em;
145
+ }
146
+
147
+ legend {
148
+ display: table;
149
+ padding: 0;
150
+ max-inline-size: 100%;
151
+ white-space: normal;
152
+ color: inherit;
153
+ box-sizing: border-box;
154
+ }
155
+
156
+ progress {
157
+ vertical-align: baseline;
158
+ }
159
+
160
+ textarea {
161
+ overflow: auto;
162
+ }
163
+
164
+ details {
165
+ display: block;
166
+ }
167
+
168
+ summary {
169
+ display: list-item;
170
+ }
171
+
172
+ template,
173
+ [hidden] {
174
+ display: none;
175
+ }
176
+
177
+ [type='checkbox'],
178
+ [type='radio'] {
179
+ box-sizing: border-box;
180
+ padding: 0;
181
+ }
182
+
183
+ [type='number']::-webkit-inner-spin-button,
184
+ [type='number']::-webkit-outer-spin-button {
185
+ block-size: auto;
186
+ }
187
+
188
+ [type='search'] {
189
+ appearance: textfield;
190
+ outline-offset: -2px;
191
+ }
192
+
193
+ [type='search']::-webkit-search-decoration {
194
+ appearance: none;
195
+ }
196
+
197
+ ::-webkit-file-upload-button {
198
+ appearance: button;
199
+ font: inherit;
200
+ }
201
+
202
+ ::-webkit-scrollbar {
203
+ inline-size: 4px;
204
+ block-size: 4px;
205
+ }
206
+
207
+ ::-webkit-scrollbar-track,
208
+ ::-webkit-scrollbar-thumb {
209
+ border-radius: 5px;
210
+ background-color: transparent;
211
+ }
212
+
213
+ :hover::-webkit-scrollbar-thumb {
214
+ background-color: var(--primary-selection);
215
+ }
216
+
217
+ ::-webkit-scrollbar-thumb:hover {
218
+ background-color: var(--primary-hover);
219
+ }
220
+
221
+ ::-webkit-scrollbar-thumb:active {
222
+ background-color: var(--primary-active);
223
+ }
224
+
225
+ ::-webkit-scrollbar-button {
226
+ display: none;
227
+ }
228
+
229
+ @keyframes route-in {
230
+ from {
231
+ transform: translate3d(0, 16px, 0);
232
+ opacity: 0;
233
+ }
234
+
235
+ to {
236
+ transform: translate3d(0, 0, 0);
237
+ opacity: 1;
238
+ }
239
+ }
240
+
241
+ @keyframes route-out {
242
+ from {
243
+ transform: translate3d(0, 0, 0);
244
+ opacity: 1;
245
+ }
246
+
247
+ to {
248
+ z-index: -1;
249
+ transform: translate3d(0, 16px, 0);
250
+ opacity: 0;
251
+ }
252
+ }
@@ -0,0 +1,7 @@
1
+ import { type Component } from 'solid-js';
2
+ declare function SuspenseComp(props: {
3
+ comp: () => Promise<{
4
+ default: Component;
5
+ }>;
6
+ }): import("solid-js").JSX.Element;
7
+ export default SuspenseComp;
@@ -0,0 +1,2 @@
1
+ import"solid-js/web";import{createComponent as o}from"solid-js/web";import r from"@app/fallback";import t from"@app/mdx-scope";import{Suspense as e,lazy as p}from"solid-js";export default function(m){let i=p(m.comp);return o(e,{get fallback(){return r&&o(r,{})},get children(){return o(i,{components:t})}})};
2
+ //# sourceMappingURL=suspense-comp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/suspense-comp.tsx"],"sourcesContent":["import Fallback from '@app/fallback';\nimport scope from '@app/mdx-scope';\nimport { type Component, Suspense, lazy } from 'solid-js';\n\nfunction SuspenseComp(props: { comp: () => Promise<{ default: Component }> }) {\n const Lazy: Component<Record<string, unknown>> = lazy(props.comp);\n\n return (\n <Suspense fallback={Fallback && <Fallback />}>\n <Lazy components={scope} />\n </Suspense>\n );\n}\n\nexport default SuspenseComp;\n"],"names":["Fallback","scope","Suspense","lazy","props","Lazy","comp"],"mappings":"mEAAA,QAAOA,MAAc,eAAgB,AACrC,QAAOC,MAAW,gBAAiB,AACnC,QAAyBC,YAAAA,CAAQ,CAAEC,QAAAA,CAAI,KAAQ,UAAW,AAY1D,gBAVA,SAAsBC,CAAsD,EAC1E,IAAMC,EAA2CF,EAAKC,EAAME,MAE5D,SACGJ,yBAAmBF,KAAaA,+BAC9BK,cAAiBJ,MAGxB,CAE4B"}
package/lib.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../../lib"
5
+ },
6
+ "include": ["../../../components", "../../../typings"],
7
+ "exclude": ["../../../*/**/__tests__/*"]
8
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@moneko/solid",
3
+ "version": "1.0.0",
4
+ "description": "Solid js",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "prebuild": "rm -rf ./lib",
8
+ "build": "swc src -d lib -D && tsc"
9
+ },
10
+ "author": "moneko",
11
+ "type": "module",
12
+ "license": "MIT",
13
+ "dependencies": {
14
+ "@moneko/jsx-dom-expressions": "0.1.0",
15
+ "@solidjs/router": "0.8.3",
16
+ "eslint-plugin-solid": "0.12.1"
17
+ },
18
+ "devDependencies": {
19
+ "@swc/cli": "0.1.62",
20
+ "@swc/core": "1.3.62",
21
+ "@types/webpack-env": "1.18.1",
22
+ "eslint-config-neko": "1.1.2",
23
+ "solid-js": "1.7.11",
24
+ "stylelint-config-moneko": "1.0.17",
25
+ "swc-plugin-another-transform-imports": "0.2.4",
26
+ "typescript": "5.0.4"
27
+ },
28
+ "files": [
29
+ "lib",
30
+ "jest-preset.js",
31
+ "base.json",
32
+ "lib.json",
33
+ "env.d.ts"
34
+ ]
35
+ }