@inglorious/web 4.0.3 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/web",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "A new web framework that leverages the power of the Inglorious Store combined with the performance and simplicity of lit-html.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -65,8 +65,8 @@
65
65
  "dependencies": {
66
66
  "@lit-labs/ssr-client": "^1.1.8",
67
67
  "lit-html": "^3.3.1",
68
- "@inglorious/store": "9.0.0",
69
- "@inglorious/utils": "3.7.1"
68
+ "@inglorious/store": "9.0.1",
69
+ "@inglorious/utils": "3.7.2"
70
70
  },
71
71
  "devDependencies": {
72
72
  "prettier": "^3.6.2",
@@ -77,8 +77,8 @@
77
77
  "node": ">= 22"
78
78
  },
79
79
  "scripts": {
80
- "format": "prettier --write '**/*.{js,jsx}'",
81
- "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
80
+ "format": "prettier --write .",
81
+ "lint": "eslint .",
82
82
  "test:watch": "vitest",
83
83
  "test": "vitest run"
84
84
  }
@@ -1,133 +1,133 @@
1
- .iw-select {
2
- .iw-select-control {
3
- min-height: 2em;
4
- border: 1px solid #ccc;
5
- border-radius: 0.25em;
6
- padding: 0.5em 0.75em;
7
- background: white;
8
- gap: 0.5em;
9
-
10
- &:hover {
11
- border-color: #999;
12
- }
13
-
14
- &.iw-select-control-open {
15
- border-color: #007bff;
16
- outline: 2px solid rgba(0, 123, 255, 0.25);
17
- }
18
-
19
- &.iw-select-control-disabled {
20
- background: #f5f5f5;
21
- cursor: not-allowed;
22
- opacity: 0.6;
23
- }
24
-
25
- &.iw-select-control-selection {
26
- padding: 0.25em 0.75em;
27
- }
28
-
29
- .iw-select-placeholder {
30
- color: #999;
31
- }
32
-
33
- .iw-select-multi-value {
34
- gap: 0.25em;
35
-
36
- .iw-select-multi-value-tag {
37
- padding: 0.25em 0.5em;
38
- background: #e9ecef;
39
- border-radius: 0.25em;
40
- gap: 0.25em;
41
-
42
- .iw-select-multi-value-tag-label {
43
- font-size: 0.75em;
44
- }
45
-
46
- .iw-select-multi-value-remove {
47
- font-size: 1.2em;
48
- line-height: 1;
49
- }
50
- }
51
- }
52
-
53
- .iw-select-clear,
54
- .iw-select-arrow {
55
- width: 1.2em;
56
- height: 1.2em;
57
- display: flex;
58
- justify-content: center;
59
- align-items: center;
60
- }
61
-
62
- .iw-select-clear {
63
- span {
64
- font-size: 1.2em;
65
- line-height: 1;
66
- }
67
- }
68
-
69
- .iw-select-arrow {
70
- transition: transform 0.2s;
71
-
72
- span {
73
- font-size: 0.75em;
74
- }
75
- }
76
-
77
- &.iw-select-control-open {
78
- .iw-select-arrow {
79
- transform: rotate(180deg);
80
- }
81
- }
82
- }
83
- .iw-select-dropdown {
84
- max-height: 18em;
85
- overflow: hidden;
86
- background: white;
87
- border: 1px solid #ccc;
88
- border-radius: 4px;
89
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
90
-
91
- .iw-select-dropdown-search {
92
- padding: 0.5em 0.75em;
93
- border: none;
94
- border-bottom: 1px solid #eee;
95
- outline: none;
96
- }
97
-
98
- .iw-select-dropdown-options {
99
- max-height: 15em;
100
- overflow-y: auto;
101
-
102
- .iw-select-dropdown-options-option {
103
- padding: 0.5em 0.75em;
104
- gap: 0.5em;
105
-
106
- &.iw-select-dropdown-options-option-disabled {
107
- opacity: 0.5;
108
- cursor: not-allowed;
109
-
110
- input[type="checkbox"] {
111
- cursor: not-allowed;
112
- }
113
- }
114
- }
115
-
116
- .iw-select-dropdown-options-option:hover,
117
- .iw-select-dropdown-options-option-focused {
118
- background: #f8f9fa;
119
- }
120
-
121
- .iw-select-dropdown-options-option-selected {
122
- background: #e7f3ff;
123
- }
124
- }
125
-
126
- .iw-select-loading,
127
- .iw-select-no-options {
128
- padding: 0.75em;
129
- text-align: center;
130
- color: #999;
131
- }
132
- }
133
- }
1
+ .iw-select {
2
+ .iw-select-control {
3
+ min-height: 2em;
4
+ border: 1px solid #ccc;
5
+ border-radius: 0.25em;
6
+ padding: 0.5em 0.75em;
7
+ background: white;
8
+ gap: 0.5em;
9
+
10
+ &:hover {
11
+ border-color: #999;
12
+ }
13
+
14
+ &.iw-select-control-open {
15
+ border-color: #007bff;
16
+ outline: 2px solid rgba(0, 123, 255, 0.25);
17
+ }
18
+
19
+ &.iw-select-control-disabled {
20
+ background: #f5f5f5;
21
+ cursor: not-allowed;
22
+ opacity: 0.6;
23
+ }
24
+
25
+ &.iw-select-control-selection {
26
+ padding: 0.25em 0.75em;
27
+ }
28
+
29
+ .iw-select-placeholder {
30
+ color: #999;
31
+ }
32
+
33
+ .iw-select-multi-value {
34
+ gap: 0.25em;
35
+
36
+ .iw-select-multi-value-tag {
37
+ padding: 0.25em 0.5em;
38
+ background: #e9ecef;
39
+ border-radius: 0.25em;
40
+ gap: 0.25em;
41
+
42
+ .iw-select-multi-value-tag-label {
43
+ font-size: 0.75em;
44
+ }
45
+
46
+ .iw-select-multi-value-remove {
47
+ font-size: 1.2em;
48
+ line-height: 1;
49
+ }
50
+ }
51
+ }
52
+
53
+ .iw-select-clear,
54
+ .iw-select-arrow {
55
+ width: 1.2em;
56
+ height: 1.2em;
57
+ display: flex;
58
+ justify-content: center;
59
+ align-items: center;
60
+ }
61
+
62
+ .iw-select-clear {
63
+ span {
64
+ font-size: 1.2em;
65
+ line-height: 1;
66
+ }
67
+ }
68
+
69
+ .iw-select-arrow {
70
+ transition: transform 0.2s;
71
+
72
+ span {
73
+ font-size: 0.75em;
74
+ }
75
+ }
76
+
77
+ &.iw-select-control-open {
78
+ .iw-select-arrow {
79
+ transform: rotate(180deg);
80
+ }
81
+ }
82
+ }
83
+ .iw-select-dropdown {
84
+ max-height: 18em;
85
+ overflow: hidden;
86
+ background: white;
87
+ border: 1px solid #ccc;
88
+ border-radius: 4px;
89
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
90
+
91
+ .iw-select-dropdown-search {
92
+ padding: 0.5em 0.75em;
93
+ border: none;
94
+ border-bottom: 1px solid #eee;
95
+ outline: none;
96
+ }
97
+
98
+ .iw-select-dropdown-options {
99
+ max-height: 15em;
100
+ overflow-y: auto;
101
+
102
+ .iw-select-dropdown-options-option {
103
+ padding: 0.5em 0.75em;
104
+ gap: 0.5em;
105
+
106
+ &.iw-select-dropdown-options-option-disabled {
107
+ opacity: 0.5;
108
+ cursor: not-allowed;
109
+
110
+ input[type="checkbox"] {
111
+ cursor: not-allowed;
112
+ }
113
+ }
114
+ }
115
+
116
+ .iw-select-dropdown-options-option:hover,
117
+ .iw-select-dropdown-options-option-focused {
118
+ background: #f8f9fa;
119
+ }
120
+
121
+ .iw-select-dropdown-options-option-selected {
122
+ background: #e7f3ff;
123
+ }
124
+ }
125
+
126
+ .iw-select-loading,
127
+ .iw-select-no-options {
128
+ padding: 0.75em;
129
+ text-align: center;
130
+ color: #999;
131
+ }
132
+ }
133
+ }
@@ -1,34 +1,34 @@
1
- .iw-table {
2
- user-select: none;
3
-
4
- .iw-table-header {
5
- display: flex;
6
- flex-direction: column;
7
- }
8
-
9
- .iw-table-header-row {
10
- display: flex;
11
- }
12
-
13
- .iw-table-header-column {
14
- display: flex;
15
- flex-direction: column;
16
- }
17
-
18
- .iw-table-filter-input,
19
- .iw-table-filter-select {
20
- width: 100%;
21
- }
22
-
23
- .iw-table-searchbar {
24
- width: 100%;
25
- }
26
-
27
- .iw-table-row {
28
- display: flex;
29
- }
30
-
31
- .iw-table-footer-row {
32
- display: flex;
33
- }
34
- }
1
+ .iw-table {
2
+ user-select: none;
3
+
4
+ .iw-table-header {
5
+ display: flex;
6
+ flex-direction: column;
7
+ }
8
+
9
+ .iw-table-header-row {
10
+ display: flex;
11
+ }
12
+
13
+ .iw-table-header-column {
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
17
+
18
+ .iw-table-filter-input,
19
+ .iw-table-filter-select {
20
+ width: 100%;
21
+ }
22
+
23
+ .iw-table-searchbar {
24
+ width: 100%;
25
+ }
26
+
27
+ .iw-table-row {
28
+ display: flex;
29
+ }
30
+
31
+ .iw-table-footer-row {
32
+ display: flex;
33
+ }
34
+ }
package/types/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from "./form"
2
2
  export * from "./list"
3
+ export * from "./lit-html"
3
4
  export * from "./mount"
4
5
  export * from "./router"
5
6
  export * from "./select"
7
+ export * from "./store"
6
8
  export * from "./table"
@@ -0,0 +1,9 @@
1
+ export { html, TemplateResult } from "lit-html"
2
+
3
+ export { choose } from "lit-html/directives/choose"
4
+ export { classMap } from "lit-html/directives/class-map"
5
+ export { ref } from "lit-html/directives/ref"
6
+ export { repeat } from "lit-html/directives/repeat"
7
+ export { styleMap } from "lit-html/directives/style-map"
8
+ export { unsafeHTML } from "lit-html/directives/unsafe-html"
9
+ export { when } from "lit-html/directives/when"
package/types/mount.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TemplateResult } from "lit-html"
2
- import type { Store, Api as StoreApi } from "@inglorious/store"
2
+ import type { BaseEntity, Store, Api as StoreApi } from "@inglorious/store"
3
3
 
4
4
  export type Api = StoreApi & {
5
5
  /**
@@ -21,8 +21,8 @@ export type Api = StoreApi & {
21
21
  * @param element The DOM element to mount the template to.
22
22
  * @returns An unsubscribe function.
23
23
  */
24
- export function mount(
25
- store: Store,
24
+ export function mount<Entity = BaseEntity, State = BaseState>(
25
+ store: Store<Entity, State>,
26
26
  renderFn: (api: Api) => TemplateResult | null,
27
27
  element: HTMLElement | DocumentFragment,
28
28
  ): () => void
@@ -0,0 +1,14 @@
1
+ export {
2
+ BaseEntity,
3
+ EntitiesState,
4
+ Event,
5
+ Middleware,
6
+ createStore,
7
+ TypesConfig,
8
+ } from "@inglorious/store"
9
+
10
+ export { createSelector } from "@inglorious/store/select"
11
+ export { trigger } from "@inglorious/store/test"
12
+
13
+ export { createDevtools } from "@inglorious/store/client/devtools"
14
+ export { multiplayerMiddleware } from "@inglorious/store/client/multiplayer-middleware"