lilact 0.15.4 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +7 -6
  2. package/bin/bundle.cjs +148 -60
  3. package/dist/lilact.development.js +5332 -10264
  4. package/dist/lilact.development.js.map +7 -1
  5. package/dist/lilact.development.min.js +54 -11
  6. package/dist/lilact.development.min.js.map +7 -1
  7. package/dist/lilact.production.min.js +53 -10
  8. package/docs/assets/hierarchy.js +1 -1
  9. package/docs/classes/accessories.ErrorBoundary.html +11 -11
  10. package/docs/classes/accessories.Suspense.html +10 -10
  11. package/docs/classes/components.Component.html +11 -11
  12. package/docs/classes/components.HTMLComponent.html +11 -11
  13. package/docs/classes/components.RootComponent.html +11 -11
  14. package/docs/functions/accessories.DragHandle.html +1 -1
  15. package/docs/functions/accessories.Spinner.html +1 -1
  16. package/docs/functions/components.createComponent.html +1 -1
  17. package/docs/functions/components.createRoot.html +1 -1
  18. package/docs/functions/components.render.html +1 -1
  19. package/docs/functions/errors.globalErrorHandler.html +1 -1
  20. package/docs/functions/errors.traceError.html +1 -1
  21. package/docs/functions/hooks.createContext.html +1 -1
  22. package/docs/functions/hooks.useActionState.html +1 -1
  23. package/docs/functions/hooks.useCallback.html +1 -1
  24. package/docs/functions/hooks.useContext.html +1 -1
  25. package/docs/functions/hooks.useDeferredValue.html +1 -1
  26. package/docs/functions/hooks.useEffect.html +1 -1
  27. package/docs/functions/hooks.useHook.html +1 -1
  28. package/docs/functions/hooks.useId.html +1 -1
  29. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  30. package/docs/functions/hooks.useLayoutEffect.html +1 -1
  31. package/docs/functions/hooks.useLocalStorage.html +1 -1
  32. package/docs/functions/hooks.useMemo.html +1 -1
  33. package/docs/functions/hooks.useReducer.html +1 -1
  34. package/docs/functions/hooks.useRef.html +1 -1
  35. package/docs/functions/hooks.useState.html +1 -1
  36. package/docs/functions/hooks.useTransition.html +1 -1
  37. package/docs/functions/misc.Fragment.html +2 -2
  38. package/docs/functions/misc.deepEqual.html +1 -1
  39. package/docs/functions/misc.findDOMNode.html +1 -1
  40. package/docs/functions/misc.forwardRef.html +1 -1
  41. package/docs/functions/misc.getComponentByPointer.html +1 -1
  42. package/docs/functions/misc.isAsync.html +1 -1
  43. package/docs/functions/misc.isClass.html +1 -1
  44. package/docs/functions/misc.isEmpty.html +1 -1
  45. package/docs/functions/misc.isError.html +1 -1
  46. package/docs/functions/misc.isThenable.html +1 -1
  47. package/docs/functions/misc.isValidElement.html +1 -1
  48. package/docs/functions/misc.shallowEqual.html +1 -1
  49. package/docs/functions/misc.toBool.html +1 -1
  50. package/docs/functions/redux.Provider.html +1 -1
  51. package/docs/functions/redux.combineReducers.html +1 -1
  52. package/docs/functions/redux.connect.html +1 -1
  53. package/docs/functions/redux.useDispatch.html +1 -1
  54. package/docs/functions/redux.useSelector.html +1 -1
  55. package/docs/functions/redux.useStore.html +1 -1
  56. package/docs/functions/router.HashRouter.html +1 -1
  57. package/docs/functions/router.Link.html +1 -1
  58. package/docs/functions/router.NavLink.html +1 -1
  59. package/docs/functions/router.Route.html +1 -1
  60. package/docs/functions/router.Routes.html +1 -1
  61. package/docs/functions/router.useLocation.html +1 -1
  62. package/docs/functions/router.useNavigate.html +1 -1
  63. package/docs/functions/run.lazy.html +1 -1
  64. package/docs/functions/run.require.html +1 -1
  65. package/docs/functions/run.run.html +1 -1
  66. package/docs/functions/run.runScripts.html +1 -1
  67. package/docs/functions/timers.animationFramePromise.html +1 -1
  68. package/docs/functions/timers.clearInterval.html +1 -1
  69. package/docs/functions/timers.clearTimeout.html +1 -1
  70. package/docs/functions/timers.grabTimers.html +1 -1
  71. package/docs/functions/timers.pauseTimers.html +1 -1
  72. package/docs/functions/timers.releaseTimers.html +1 -1
  73. package/docs/functions/timers.resetTimers.html +1 -1
  74. package/docs/functions/timers.resumeTimers.html +1 -1
  75. package/docs/functions/timers.setInterval.html +1 -1
  76. package/docs/functions/timers.setTimeout.html +1 -1
  77. package/docs/functions/timers.timeoutPromise.html +12 -12
  78. package/docs/functions/transition.CSSTransition.html +1 -1
  79. package/docs/functions/transition.SwitchTransition.html +1 -1
  80. package/docs/functions/transition.Transition.html +1 -1
  81. package/docs/functions/transition.TransitionGroup.html +1 -1
  82. package/docs/hierarchy.html +1 -1
  83. package/docs/index.html +8 -7
  84. package/docs/static/index.html +2 -0
  85. package/docs/static/lilact.development.js +5332 -10264
  86. package/docs/static/lilact.development.js.map +7 -0
  87. package/docs/static/lilact.development.min.js +54 -11
  88. package/docs/static/lilact.development.min.js.map +7 -0
  89. package/docs/static/lilact.production.min.js +53 -10
  90. package/docs/variables/accessories.SplitPane.html +1 -1
  91. package/docs/variables/misc.Children.html +2 -2
  92. package/package.json +11 -14
  93. package/root/index.html +2 -0
  94. package/root/lilact.development.js +5332 -10264
  95. package/root/lilact.development.js.map +7 -0
  96. package/root/lilact.development.min.js +54 -11
  97. package/root/lilact.development.min.js.map +7 -0
  98. package/root/lilact.production.min.js +53 -10
  99. package/{webpack.config.factory.cjs → scripts/build.mjs} +48 -73
  100. package/scripts/copy-dist-to-root.mjs +13 -0
  101. package/scripts/esbuild-preprocessor-plugin.cjs +29 -0
  102. package/scripts/preprocess.mjs +42 -0
  103. package/src/accessories.jsx +2 -28
  104. package/src/components.jsx +1 -1
  105. package/src/hooks.jsx +5 -6
  106. package/src/jsx.js +30 -26
  107. package/src/lilact.jsx +3 -2
  108. package/src/proptypes.jsx +407 -0
  109. package/tsconfig.json +1 -2
  110. package/typedoc.json +13 -13
  111. package/dist/lilact.development.min.js.LICENSE.txt +0 -83
  112. package/dist/lilact.production.min.js.map +0 -1
  113. package/src/loader.cjs +0 -59
  114. package/webpack.config.js +0 -206
package/src/loader.cjs DELETED
@@ -1,59 +0,0 @@
1
- /*
2
-
3
- Lilact
4
- Copyright (C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>
5
- All rights reserved.
6
-
7
- BSD-2-Clause
8
-
9
- Redistribution and use in source and binary forms, with or without
10
- modification, are permitted provided that the following conditions are met:
11
-
12
- * Redistributions of source code must retain the above copyright
13
- notice, this list of conditions and the following disclaimer.
14
- * Redistributions in binary form must reproduce the above copyright
15
- notice, this list of conditions and the following disclaimer in the
16
- documentation and/or other materials provided with the distribution.
17
-
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
-
29
- */
30
-
31
- // Loader for JSX transpiler in webpack. Check webpack.config.js for the rules.
32
-
33
- const {transpileJSX, transpilerConfig} = require ('./jsx.js');
34
-
35
- module.exports = function loader(source) {
36
-
37
- const opts = this.getOptions();
38
-
39
- globalThis.DEBUG = opts.mode!=='production';
40
-
41
- // globalThis.Lilact = Object.assign(globalThis.Lilact || {},
42
- // {
43
- // transpilerConfig
44
- // });
45
-
46
- console.log("Transpiling", this.resource);
47
- source = transpileJSX(source,
48
- {
49
- path: this.resource,
50
- appendSourcemap: DEBUG,
51
- //factory: "createComponent",
52
- //mappings: [],
53
- //injectTraceLabels: false,
54
- //discardComments: false
55
- }
56
- );
57
-
58
- return source;
59
- };
package/webpack.config.js DELETED
@@ -1,206 +0,0 @@
1
- /*
2
-
3
- Lilact
4
- Copyright (C) 2024-2025 Arash Kazemi <contact.arash.kazemi@gmail.com>
5
- All rights reserved.
6
-
7
- BSD-2-Clause
8
-
9
- Redistribution and use in source and binary forms, with or without
10
- modification, are permitted provided that the following conditions are met:
11
-
12
- * Redistributions of source code must retain the above copyright
13
- notice, this list of conditions and the following disclaimer.
14
- * Redistributions in binary form must reproduce the above copyright
15
- notice, this list of conditions and the following disclaimer in the
16
- documentation and/or other materials provided with the distribution.
17
-
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
-
29
- */
30
-
31
- import path from 'path'
32
-
33
- import { fileURLToPath } from 'url';
34
- import { dirname, resolve } from 'path';
35
-
36
- import fs from 'fs';
37
- import webpack from 'webpack';
38
-
39
-
40
- export default (env, argv) => {
41
- const mode = argv.mode || 'development';
42
- const minify = env?.minify==='true';
43
-
44
- const __filename = fileURLToPath(import.meta.url);
45
- const __dirname = dirname(__filename);
46
-
47
- const filename = `lilact.${mode}${minify?'.min':''}.js`;
48
-
49
- return {
50
- entry: './src/lilact.jsx',
51
- mode,
52
- devtool: 'source-map',
53
-
54
- optimization: {
55
- concatenateModules: true, // scope hoisting
56
- moduleIds: 'deterministic', // smaller stable ids (or 'hashed')
57
- minimize: minify,
58
- },
59
- experiments: {
60
- outputModule: true // enable module output
61
- },
62
- ignoreWarnings: [{
63
- module: /jsx\.js/, // to silent the warning for requiring fs in jsx.js
64
- message: /Module not found/,
65
- }],
66
- output: {
67
- filename,
68
- path: path.resolve(__dirname, 'dist'),
69
- library: {
70
- type: 'module' // important: emit an ES module
71
- },
72
- },
73
- resolve: {
74
- // alias: {
75
- // "react-is": false,
76
- // },
77
- fallback: {
78
- // buffer: req.resolve('buffer/'),
79
- }
80
- },
81
- module: {
82
- rules: [{
83
- test: /\.js$/, // for the preprocessor
84
- exclude: /node_modules/,
85
- use: [{
86
- loader: './src/loader.cjs',
87
- options: {
88
- mode
89
- }
90
- }]
91
- },
92
- {
93
- test: /\.jsx$/,
94
- exclude: /node_modules/,
95
- use: [{
96
- loader: './src/loader.cjs',
97
- options: {
98
- mode
99
- }
100
- }]
101
- },
102
- {
103
- test: /\.css$/i,
104
- use: [
105
- {
106
- loader: "style-loader"
107
- },
108
- {
109
- loader: "css-loader",
110
- options: {
111
- // keeps behavior simple; you can enable modules if you want
112
- modules: false,
113
- importLoaders: 0
114
- }
115
- }
116
- ]
117
- }
118
- ]
119
- },
120
- plugins: [
121
- new webpack.DefinePlugin({
122
- "DEBUG": mode==='development'
123
- }),
124
-
125
- {
126
- apply: (compiler) => {
127
- compiler.hooks.done.tap('license-plugin', (compilation) => {
128
- fs.readFile('./dist/' + filename, 'utf8', function(err, jssc) {
129
-
130
- let out =
131
- `/*
132
-
133
- Lilact
134
- Copyright (C) 2024-2025 Arash Kazemi <contact.arash.kazemi@gmail.com>
135
- All rights reserved.
136
-
137
- BSD-2-Clause
138
-
139
- Redistribution and use in source and binary forms, with or without
140
- modification, are permitted provided that the following conditions are met:
141
-
142
- * Redistributions of source code must retain the above copyright
143
- notice, this list of conditions and the following disclaimer.
144
- * Redistributions in binary form must reproduce the above copyright
145
- notice, this list of conditions and the following disclaimer in the
146
- documentation and/or other materials provided with the distribution.
147
-
148
- --------------------------------------------------------------------------------
149
-
150
- Lilact also includes the following libraries accessible as members of
151
- the Lilact object:
152
-
153
- @emotion/css:
154
- Copyright (c) Emotion team and other contributors
155
- MIT License
156
-
157
- prop-types:
158
- Copyright (c) 2013-present, Facebook, Inc.
159
- MIT License
160
-
161
- redux:
162
- Copyright (c) 2015-present Dan Abramov
163
- MIT License
164
-
165
-
166
- * MIT License Notice:
167
-
168
- Permission is hereby granted, free of charge, to any person obtaining a copy
169
- of this software and associated documentation files (the "Software"), to deal
170
- in the Software without restriction, including without limitation the rights
171
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
172
- copies of the Software, and to permit persons to whom the Software is
173
- furnished to do so, subject to the following conditions:
174
-
175
- The above copyright notice and this permission notice shall be included in all
176
- copies or substantial portions of the Software.
177
-
178
- --------------------------------------------------------------------------------
179
-
180
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
181
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
182
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
183
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
184
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
185
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
186
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
187
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
188
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
189
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
190
-
191
- */
192
- ${jssc}`;
193
-
194
- fs.writeFile('./dist/' + filename, out, {}, function() {});
195
- fs.writeFile('./root/' + filename, out, {}, function() {});
196
- });
197
-
198
- });
199
- }
200
- },
201
- //new webpack.ProvidePlugin({
202
- //Buffer: ['buffer', 'Buffer'],
203
- // })
204
- ]
205
- }
206
- };