hyperapp-is 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -127,6 +127,7 @@ JSX を使用する場合は `hyperapp-jsx-pragma` を前提としています
127
127
  npm で非公開の関数 (実験用)は、解説に記載します
128
128
 
129
129
  **core / state.ts**
130
+ - [Keys](#keys)
130
131
  - [getValue](#getvalue)
131
132
  - [setValue](#setvalue)
132
133
  - [getLocalState](#getlocalstate)
@@ -134,6 +135,8 @@ npm で非公開の関数 (実験用)は、解説に記載します
134
135
  - [createLocalKey](#createlocalkey)
135
136
 
136
137
  **core / component.ts**
138
+ - [Keys_String](#keys_string-keys_arraystring)
139
+ - [Keys_ArrayString](#keys_string-keys_arraystring)
137
140
  - [el](#el)
138
141
  - [concatAction](#concataction)
139
142
  - [getClassList](#getclasslist)
@@ -142,6 +145,15 @@ npm で非公開の関数 (実験用)は、解説に記載します
142
145
  - [SelectButton](#selectbutton)
143
146
  - [OptionButton](#optionbutton)
144
147
 
148
+ **core / navigator.ts**
149
+ - [Keys_NavigatorItem](#keys_navigatoritem)
150
+ - [NavigatorItem](#navigatoritem)
151
+ - [JsonEntry](#jsonentry)
152
+ - [NavigatorColumn](#navigatorcolumn)
153
+ - [convertJsonToNavigatorItem](#convertjsontonavigatoritem)
154
+ - [getParentItems](#getparentitems)
155
+ - [NavigatorFinder](#navigatorfinder)
156
+
145
157
  **animation / step.ts**
146
158
  - [effect_throwMessageStart](#effect_throwmessagestart)
147
159
  - [effect_throwMessagePause](#effect_throwmessagepause--effect_throwmessageresume)
@@ -198,11 +210,17 @@ src
198
210
 
199
211
  ├ core
200
212
  │ ├ state.ts
213
+ │ │ Keys
201
214
  │ │ getValue, setValue, getLocalState, setLocalState, createLocalKey
202
215
  │ │
203
- component.ts
204
- el, concatAction, getClassList, deleteKeys
205
- Route, SelectButton, OptionButton
216
+ component.ts
217
+ │ Keys_String, Keys_ArrayString
218
+ │ el, concatAction, getClassList, deleteKeys
219
+ │ │ Route, SelectButton, OptionButton
220
+ │ │
221
+ │ └ navigator.ts
222
+ │ Keys_NavigatorItem, NavigatorItem, JsonEntry, NavigatorColumn
223
+ │ convertJsonToNavigatorItem, getParentItems, NavigatorFinder
206
224
 
207
225
  ├ animation
208
226
  │ ├ step.ts
@@ -249,6 +267,15 @@ src
249
267
 
250
268
  ## hyperapp-is/core
251
269
 
270
+ ### Keys
271
+ ステートの任意の値までのパスを表す、文字配列の型エイリアス
272
+
273
+ ```ts
274
+ export type Keys = readonly string[]
275
+ ```
276
+
277
+ ---
278
+
252
279
  ### getValue
253
280
  パスを辿ってステートから値を取得
254
281
  安全にアクセス可能
@@ -327,6 +354,11 @@ export const createLocalKey = (id: string): string => `local_key_${ id }`
327
354
 
328
355
  ---
329
356
 
357
+ ### Keys_String, Keys_ArrayString
358
+ ステートの任意の値までのパスを表す、文字配列の型エイリアス
359
+
360
+ ---
361
+
330
362
  ### el
331
363
  Hyperapp の h 関数ラッパー。JSX と競合する場合に使用
332
364
  children の処理も同時に行っているため、本ライブラリでは VNode を作成する際に使用しています
@@ -465,6 +497,142 @@ export const OptionButton = function <S> (
465
497
  - props.reverse?: 反転選択するか
466
498
  - children : 子要素 (VNode / string / 配列など)
467
499
 
500
+ ---
501
+
502
+ ### Keys_NavigatorItem
503
+ ステートの任意の値までのパスを表す、文字配列の型エイリアス
504
+
505
+ ---
506
+
507
+ ### NavigatorItem
508
+ ツリー構造となるナビゲーションオブジェクト
509
+
510
+ ```ts
511
+ export interface NavigatorItem {
512
+ parent : NavigatorItem | null
513
+ name : string
514
+ properties?: Record<string, any>
515
+ children ?: NavigatorItem[]
516
+ path : string
517
+ extension ?: Record<string, any>
518
+ }
519
+ ```
520
+
521
+ - parent : 親アイテム
522
+ - name : 名前
523
+ - properties: プロパティ
524
+ - children : 子アイテム
525
+ - path : パス
526
+ - extension : 拡張オブジェクト
527
+
528
+ ---
529
+
530
+ ### JsonEntry
531
+ getEntriesの返す値
532
+
533
+ ```ts
534
+ export interface JsonEntry <D> {
535
+ name : string
536
+ data : D
537
+ isProperty: boolean
538
+ isNode : boolean
539
+ }
540
+ ```
541
+
542
+ - name : 名前
543
+ - data : データ
544
+ - isProperty: プロパティか
545
+ - isNode : ディレクトリか
546
+
547
+ ---
548
+
549
+ ### NavigatorColumn
550
+ NavigatorFinder に渡すヘッダーと値
551
+
552
+ ```ts
553
+ export interface NavigatorColumn {
554
+ name: string
555
+ val : (item: NavigatorItem) => any
556
+ }
557
+ ```
558
+
559
+ - name: 名前
560
+ - val : 値を返す関数
561
+
562
+ ---
563
+
564
+ ### convertJsonToNavigatorItem
565
+ Json から NavigatorItem に変換
566
+ getEntries の採用により、JSON の形を問わない
567
+
568
+ ```ts
569
+ export const convertJsonToNavigatorItem = function <D> (
570
+ props: {
571
+ parent : NavigatorItem | null
572
+ name : string
573
+ data : D
574
+ getEntries : (data: D, depth: number) => JsonEntry<D>[]
575
+ isNode : boolean
576
+ depth ?: number
577
+ extension ?: (item: NavigatorItem, data: D, depth: number) => Record<string, any> | undefined
578
+ }
579
+ ): NavigatorItem
580
+ ```
581
+
582
+ - parent : 親アイテム
583
+ - name : 名前
584
+ - data : データ
585
+ - getEntries: JsonEntry配列を返す関数
586
+ - isNode : ディレクトリか
587
+ - depth : 階層の深さ
588
+ - extension : 拡張オブジェクトを作成する関数
589
+
590
+ ---
591
+
592
+ ### getParentItems
593
+ NavigatorItem から 親アイテムのリストを取得する
594
+ 自分自信はリストに含まない
595
+
596
+ ```ts
597
+ export const getParentItems = (
598
+ item: NavigatorItem | undefined
599
+ ): NavigatorItem[]
600
+ ```
601
+
602
+ ---
603
+
604
+ ### NavigatorFinder
605
+ ナビゲーターファインダーコンポーネント
606
+
607
+ ```ts
608
+ export const NavigatorFinder = function <S> (
609
+ props: {
610
+ state : S
611
+ currentKeys : Keys_NavigatorItem
612
+ columns ?: NavigatorColumn[]
613
+ maxItemsCount?: number
614
+ itemClick ?: (state: S, item: NavigatorItem) => S | [S, Effect<S>]
615
+ afterRender ?: (props: {
616
+ state : S
617
+ current ?: NavigatorItem
618
+ extension?: Record<string, any>
619
+ }, vnode: VNode<S>) => VNode<S>
620
+ extension ?: Record<string, any>
621
+ [key: string]: any
622
+ }
623
+ ): VNode<S>
624
+ ```
625
+
626
+ - state : ステート
627
+ - currentKeys : カレント NavigatorItem までのパス
628
+ - columns : NavigatorColumn の配列
629
+ - maxItemsCount: 最大表示するアイテム数
630
+ - itemClick : アイテムをクリックした時のアクション
631
+ - afterRender : レンダーフック
632
+ - extension : レンダーフックに渡す拡張情報
633
+
634
+ ---
635
+
468
636
  ## hyperapp-is/animation
469
637
 
470
638
  ### effect_throwMessageStart
@@ -599,7 +767,7 @@ export class RAFTask <S> {
599
767
  action : RAFEvent<S>
600
768
  finish ?: RAFEvent<S>
601
769
  priority ?: number
602
- extension?: { [key: string]: any }
770
+ extension?: Record<string, any>
603
771
  })
604
772
 
605
773
  // getter
@@ -614,7 +782,7 @@ export class RAFTask <S> {
614
782
  // getter / setter
615
783
  groupID : string | undefined
616
784
  priority : number
617
- extension: { [key: string]: any }
785
+ extension: Record<string, any>
618
786
  isDone : boolean
619
787
  paused : boolean
620
788
 
@@ -729,7 +897,7 @@ export const createRAFProperties = function <S> (
729
897
  finish?: (state: S, rafTask: RAFTask<S>) => S | [S, InternalEffect<S>]
730
898
 
731
899
  priority ?: number
732
- extension?: { [key: string]: any }
900
+ extension?: Record<string, any>
733
901
 
734
902
  properties: CSSProperty[]
735
903
  }
@@ -756,7 +924,7 @@ export const effect_RAFProperties = function <S>(
756
924
  finish?: (state: S, rafTask: RAFTask<S>) => S | [S, InternalEffect<S>]
757
925
 
758
926
  priority ?: number
759
- extension?: { [key: string]: any }
927
+ extension?: Record<string, any>
760
928
 
761
929
  properties: CSSProperty[]
762
930
  keyNames : string[]
@@ -808,7 +976,7 @@ export const createRAFTranslate = function <S> (
808
976
  finish?: (state: S, rafTask: RAFTask<S>) => S | [S, InternalEffect<S>]
809
977
 
810
978
  priority ?: number
811
- extension?: { [key: string]: any }
979
+ extension?: Record<string, any>
812
980
 
813
981
  translateState: TranslateState
814
982
  }
@@ -836,7 +1004,7 @@ export const effect_translateStart = function <S> (
836
1004
  finish?: (state: S, rafTask: RAFTask<S>) => S | [S, InternalEffect<S>]
837
1005
 
838
1006
  priority ?: number
839
- extension?: { [key: string]: any }
1007
+ extension?: Record<string, any>
840
1008
 
841
1009
  easing ?: (t: number) => number
842
1010
 
@@ -1023,7 +1191,7 @@ export interface CarouselState <S> {
1023
1191
  duration ?: number
1024
1192
  delay ?: number
1025
1193
  priority ?: number
1026
- extension?: { [key: string]: any }
1194
+ extension?: Record<string, any>
1027
1195
 
1028
1196
  // event
1029
1197
  action?: RAFEvent<S>
@@ -1,4 +1,4 @@
1
- // hyperapp-ui / animation / easing.ts
1
+ // hyperapp-is / animation / easing.ts
2
2
  // ---------- ---------- ---------- ---------- ----------
3
3
  // progress_easing
4
4
  // ---------- ---------- ---------- ---------- ----------
@@ -1,3 +1,4 @@
1
+ // hyperapp-is / animation / index.ts
1
2
  export { RAFTask, subscription_RAFManager } from "./raf";
2
3
  export { progress_easing } from "./easing";
3
4
  export { createUnits, createRAFProperties, effect_RAFProperties } from "./properties";
@@ -37,9 +37,7 @@ export declare const createRAFProperties: <S>(props: {
37
37
  delay?: number;
38
38
  finish?: (state: S, rafTask: RAFTask<S>) => S | [S, InternalEffect<S>];
39
39
  priority?: number;
40
- extension?: {
41
- [key: string]: any;
42
- };
40
+ extension?: Record<string, any>;
43
41
  properties: CSSProperty[];
44
42
  }) => RAFTask<S>;
45
43
  /**
@@ -56,9 +54,7 @@ export declare const effect_RAFProperties: <S>(props: {
56
54
  delay?: number;
57
55
  finish?: (state: S, rafTask: RAFTask<S>) => S | [S, InternalEffect<S>];
58
56
  priority?: number;
59
- extension?: {
60
- [key: string]: any;
61
- };
57
+ extension?: Record<string, any>;
62
58
  properties: CSSProperty[];
63
59
  keyNames: string[];
64
60
  }) => (dispatch: Dispatch<S>) => void;
@@ -1,4 +1,4 @@
1
- // hyperapp-ui / animation / properties.ts
1
+ // hyperapp-is / animation / properties.ts
2
2
  import { getValue, setValue } from "../core/state";
3
3
  import { RAFTask } from "./raf";
4
4
  // ---------- ---------- ---------- ---------- ----------
@@ -1,4 +1,5 @@
1
1
  import { Effect, Subscription } from "hyperapp";
2
+ import { Keys_ArrayRAFTask } from "../core/state";
2
3
  /**
3
4
  * 戻値としては返されないことを示したエフェクト
4
5
  * Effect の型エイリアス
@@ -20,9 +21,7 @@ export declare class RAFTask<S> {
20
21
  action: RAFEvent<S>;
21
22
  finish?: RAFEvent<S>;
22
23
  priority?: number;
23
- extension?: {
24
- [key: string]: any;
25
- };
24
+ extension?: Record<string, any>;
26
25
  });
27
26
  get id(): string;
28
27
  get groupID(): string | undefined;
@@ -31,18 +30,14 @@ export declare class RAFTask<S> {
31
30
  get action(): RAFEvent<S>;
32
31
  get finish(): RAFEvent<S> | undefined;
33
32
  get priority(): number;
34
- get extension(): {
35
- [key: string]: any;
36
- };
33
+ get extension(): Record<string, any>;
37
34
  get progress(): number;
38
35
  get deltaTime(): number;
39
36
  get isDone(): boolean;
40
37
  get paused(): boolean;
41
38
  set groupID(val: string | undefined);
42
39
  set priority(val: number);
43
- set extension(val: {
44
- [key: string]: any;
45
- });
40
+ set extension(val: Record<string, any>);
46
41
  set isDone(val: boolean);
47
42
  set paused(val: boolean);
48
43
  /**
@@ -63,9 +58,9 @@ export declare class RAFTask<S> {
63
58
  * RAFTask 配列をフレームごとに実行するサブスクリプション
64
59
  *
65
60
  * @template S
66
- * @param {S} state - ステート
67
- * @param {string[]} keyNames - RAFTask 配列までのパス
61
+ * @param {S} state - ステート
62
+ * @param {Keys_ArrayRAFTask} keyNames - RAFTask 配列までのパス
68
63
  * @returns {Subscription<S>}
69
64
  */
70
- export declare const subscription_RAFManager: <S>(state: S, keyNames: string[]) => Subscription<S>;
65
+ export declare const subscription_RAFManager: <S>(state: S, keyNames: Keys_ArrayRAFTask) => Subscription<S>;
71
66
  export {};
@@ -1,4 +1,4 @@
1
- // hyperapp-ui / animation / raf.ts
1
+ // hyperapp-is / animation / raf.ts
2
2
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
3
  if (kind === "m") throw new TypeError("Private method is not writable");
4
4
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -143,8 +143,8 @@ export class RAFTask {
143
143
  * RAFTask 配列をフレームごとに実行するサブスクリプション
144
144
  *
145
145
  * @template S
146
- * @param {S} state - ステート
147
- * @param {string[]} keyNames - RAFTask 配列までのパス
146
+ * @param {S} state - ステート
147
+ * @param {Keys_ArrayRAFTask} keyNames - RAFTask 配列までのパス
148
148
  * @returns {Subscription<S>}
149
149
  */
150
150
  export const subscription_RAFManager = function (state, keyNames) {
@@ -1,4 +1,5 @@
1
1
  import { VNode, Dispatch } from "hyperapp";
2
+ import { Keys_Number, Keys_ArrayRAFTask } from "../core/state";
2
3
  import { RAFEvent, RAFTask } from "../animation/raf";
3
4
  /**
4
5
  * Carousel コンポーネント情報
@@ -19,7 +20,7 @@ import { RAFEvent, RAFTask } from "../animation/raf";
19
20
  * @property {number} [duration] - 1回あたりの実行時間 (ms)
20
21
  * @property {number} [delay] - 待機時間 (ms)
21
22
  * @property {number} [priority] - 処理優先巡視 (未実装)
22
- * @property {{ [key: string]: any}} [extension] - 拡張用プロパティ
23
+ * @property {Record<string, any>} [extension] - 拡張用プロパティ
23
24
  *
24
25
  * event
25
26
  * @property {RAFEvent<S>} [action] - 毎フレーム発生するイベント
@@ -29,7 +30,7 @@ import { RAFEvent, RAFTask } from "../animation/raf";
29
30
  * @property {(t: number) => number} easing - easing 関数
30
31
  *
31
32
  * report
32
- * @property {string[]} [reportPageIndex] - 現在表示中インデックスの出力パス
33
+ * @property {Keys_Number} [reportPageIndex] - 現在表示中インデックスの出力パス
33
34
  */
34
35
  export interface CarouselState<S> {
35
36
  id: string;
@@ -38,13 +39,11 @@ export interface CarouselState<S> {
38
39
  duration?: number;
39
40
  delay?: number;
40
41
  priority?: number;
41
- extension?: {
42
- [key: string]: any;
43
- };
42
+ extension?: Record<string, any>;
44
43
  action?: RAFEvent<S>;
45
44
  finish?: RAFEvent<S>;
46
45
  easing?: (t: number) => number;
47
- reportPageIndex?: string[];
46
+ reportPageIndex?: Keys_Number;
48
47
  }
49
48
  /**
50
49
  * 外部から Carousel コンポーネントを操作するためのクラス
@@ -67,19 +66,19 @@ export interface CarouselController<S> {
67
66
  * Carousel Component
68
67
  *
69
68
  * @template S
70
- * @param {Object} props - props
71
- * @param {S} props.state - ステート
72
- * @param {string} props.id - ユニークID (DOM id)
73
- * @param {string[]} props.keyNames - RAFTask 配列までのパス
74
- * @param {boolean} [props.controlButton] - ページ切り替えボタンを表示する (未実装)
75
- * @param {boolean} [props.controlBar] - 現在位置を示すステータスバーを表示する
76
- * @param {number} [skipSpeedRate] - skip 時に duration に乗じる値
77
- * @param {any} children - 表示するページ (HTMLLIElement の子になる)
69
+ * @param {Object} props - props
70
+ * @param {S} props.state - ステート
71
+ * @param {string} props.id - ユニークID (DOM id)
72
+ * @param {Keys_ArrayRAFTask} props.keyNames - RAFTask 配列までのパス
73
+ * @param {boolean} [props.controlButton] - ページ切り替えボタンを表示する (未実装)
74
+ * @param {boolean} [props.controlBar] - 現在位置を示すステータスバーを表示する
75
+ * @param {number} [skipSpeedRate] - skip 時に duration に乗じる値
76
+ * @param {any} children - 表示するページ (HTMLLIElement の子になる)
78
77
  */
79
78
  export declare const Carousel: <S>(props: {
80
79
  state: S;
81
80
  id: string;
82
- keyNames: string[];
81
+ keyNames: Keys_ArrayRAFTask;
83
82
  controlButton?: boolean;
84
83
  controlBar?: boolean;
85
84
  skipSpeedRate?: number;
@@ -88,8 +87,8 @@ export declare const Carousel: <S>(props: {
88
87
  /**
89
88
  * カルーセルを初期化し起動するエフェクト
90
89
  *
91
- * @param {string[]} keyNames - RAFTask 配列までのパス
92
- * @param {CarouselState} carouselState - カルーセル情報
90
+ * @param {Keys_ArrayRAFTask} keyNames - RAFTask 配列までのパス
91
+ * @param {CarouselState} carouselState - カルーセル情報
93
92
  * @returns {(dispatch: Dispatch<S>) => void}
94
93
  */
95
- export declare const effect_InitCarousel: <S>(keyNames: string[], carouselState: CarouselState<S>) => (dispatch: Dispatch<S>) => void;
94
+ export declare const effect_InitCarousel: <S>(keyNames: Keys_ArrayRAFTask, carouselState: CarouselState<S>) => (dispatch: Dispatch<S>) => void;
@@ -1,6 +1,4 @@
1
- // ---------- ---------- ---------- ---------- ----------
2
- // import
3
- // ---------- ---------- ---------- ---------- ----------
1
+ // hyperapp-is / animationView / carousel.ts
4
2
  import { getValue, setValue, createLocalKey } from "../core/state";
5
3
  import { el, deleteKeys } from "../core/component";
6
4
  import { RAFTask } from "../animation/raf";
@@ -16,14 +14,14 @@ const button = el("button");
16
14
  * Carousel Component
17
15
  *
18
16
  * @template S
19
- * @param {Object} props - props
20
- * @param {S} props.state - ステート
21
- * @param {string} props.id - ユニークID (DOM id)
22
- * @param {string[]} props.keyNames - RAFTask 配列までのパス
23
- * @param {boolean} [props.controlButton] - ページ切り替えボタンを表示する (未実装)
24
- * @param {boolean} [props.controlBar] - 現在位置を示すステータスバーを表示する
25
- * @param {number} [skipSpeedRate] - skip 時に duration に乗じる値
26
- * @param {any} children - 表示するページ (HTMLLIElement の子になる)
17
+ * @param {Object} props - props
18
+ * @param {S} props.state - ステート
19
+ * @param {string} props.id - ユニークID (DOM id)
20
+ * @param {Keys_ArrayRAFTask} props.keyNames - RAFTask 配列までのパス
21
+ * @param {boolean} [props.controlButton] - ページ切り替えボタンを表示する (未実装)
22
+ * @param {boolean} [props.controlBar] - 現在位置を示すステータスバーを表示する
23
+ * @param {number} [skipSpeedRate] - skip 時に duration に乗じる値
24
+ * @param {any} children - 表示するページ (HTMLLIElement の子になる)
27
25
  */
28
26
  export const Carousel = function (props, children) {
29
27
  var _a;
@@ -111,7 +109,7 @@ export const Carousel = function (props, children) {
111
109
  onmouseleave: action_mouseleave
112
110
  }, items.map(item => li({}, item))),
113
111
  // controlButton, controlBar
114
- (controlButton || controlBar) && div({}, controlButton
112
+ (controlButton || controlBar) ? div({}, controlButton
115
113
  ? button({ onclick: action_prevPage }, "<")
116
114
  : null, controlBar
117
115
  ? ul({}, items.map((_, i) => li({
@@ -122,15 +120,15 @@ export const Carousel = function (props, children) {
122
120
  param
123
121
  ? i === index ? "◉" : "・"
124
122
  : "・")))
125
- : ul({}), controlButton
123
+ : null, controlButton
126
124
  ? button({ onclick: action_nextPage }, ">")
127
- : null));
125
+ : null) : null);
128
126
  };
129
127
  /**
130
128
  * カルーセルを初期化し起動するエフェクト
131
129
  *
132
- * @param {string[]} keyNames - RAFTask 配列までのパス
133
- * @param {CarouselState} carouselState - カルーセル情報
130
+ * @param {Keys_ArrayRAFTask} keyNames - RAFTask 配列までのパス
131
+ * @param {CarouselState} carouselState - カルーセル情報
134
132
  * @returns {(dispatch: Dispatch<S>) => void}
135
133
  */
136
134
  export const effect_InitCarousel = function (keyNames, carouselState) {
@@ -1 +1,2 @@
1
+ // hyperapp-is / animationView / index.ts
1
2
  export { Carousel, effect_InitCarousel } from "./carousel";
@@ -1,4 +1,5 @@
1
1
  import { VNode, Effect } from "hyperapp";
2
+ import { Keys_String, Keys_ArrayString } from "./state";
2
3
  /**
3
4
  * h 関数のラッパー
4
5
  * 他でjsxを使用した場合、hが競合する可能性があるので作成した
@@ -45,14 +46,14 @@ export declare const deleteKeys: <T extends Record<string, any>>(props: T, ...ke
45
46
  * @template S
46
47
  * @param {Record<string, any>} props - props
47
48
  * @param {S} props.state - ステート
48
- * @param {string[]} props.keyNames - ステート内の文字までのパス
49
+ * @param {Keys_String} props.keyNames - ステート内の文字までのパス
49
50
  * @param {string} props.match - 一致判定する文字
50
51
  * @param {any} children - 出力する内容 (VNode / 配列 / 文字など)
51
52
  * @returns {VNode<S> | null}
52
53
  */
53
54
  export declare const Route: <S>(props: {
54
55
  state: S;
55
- keyNames: string[];
56
+ keyNames: Keys_String;
56
57
  match: string;
57
58
  }, children: any) => VNode<S> | null;
58
59
  /**
@@ -61,7 +62,7 @@ export declare const Route: <S>(props: {
61
62
  * @template S
62
63
  * @param {Record<string, any>} props - props
63
64
  * @param {S} props.state - ステート
64
- * @param {string[]} props.keyNames - ステート内の文字配列までのパス
65
+ * @param {Keys_ArrayString} props.keyNames - ステート内の文字配列までのパス
65
66
  * @param {string} props.id - ユニークID
66
67
  * @param {boolean} [props.reverse] - 反転選択するか
67
68
  * @param {any} children - 子要素 (VNode / string / 配列など)
@@ -69,7 +70,7 @@ export declare const Route: <S>(props: {
69
70
  */
70
71
  export declare const SelectButton: <S>(props: {
71
72
  state: S;
72
- keyNames: string[];
73
+ keyNames: Keys_ArrayString;
73
74
  id: string;
74
75
  reverse?: boolean;
75
76
  [key: string]: any;
@@ -80,7 +81,7 @@ export declare const SelectButton: <S>(props: {
80
81
  * @template S
81
82
  * @param {Record<string, any>} props - props
82
83
  * @param {S} props.state - ステート
83
- * @param {string[]} props.keyNames - ステート内の文字までのパス
84
+ * @param {Keys_String} props.keyNames - ステート内の文字までのパス
84
85
  * @param {string} props.id - ユニークID
85
86
  * @param {boolean} [props.reverse] - 反転選択するか
86
87
  * @param {any} children - 子要素 (VNode / string / 配列など)
@@ -88,7 +89,7 @@ export declare const SelectButton: <S>(props: {
88
89
  */
89
90
  export declare const OptionButton: <S>(props: {
90
91
  state: S;
91
- keyNames: string[];
92
+ keyNames: Keys_String;
92
93
  id: string;
93
94
  reverse?: boolean;
94
95
  [key: string]: any;
@@ -1,4 +1,4 @@
1
- // hyperapp-ui / core / component.ts
1
+ // hyperapp-is / core / component.ts
2
2
  import { h, text } from "hyperapp";
3
3
  import { getValue, setValue } from "./state";
4
4
  // ========== ========== ========== ========== ==========
@@ -87,7 +87,7 @@ export const deleteKeys = (props, ...keys) => {
87
87
  * @template S
88
88
  * @param {Record<string, any>} props - props
89
89
  * @param {S} props.state - ステート
90
- * @param {string[]} props.keyNames - ステート内の文字までのパス
90
+ * @param {Keys_String} props.keyNames - ステート内の文字までのパス
91
91
  * @param {string} props.match - 一致判定する文字
92
92
  * @param {any} children - 出力する内容 (VNode / 配列 / 文字など)
93
93
  * @returns {VNode<S> | null}
@@ -108,7 +108,7 @@ const REVERSE_PREFIX = "r_";
108
108
  * @template S
109
109
  * @param {Record<string, any>} props - props
110
110
  * @param {S} props.state - ステート
111
- * @param {string[]} props.keyNames - ステート内の文字配列までのパス
111
+ * @param {Keys_ArrayString} props.keyNames - ステート内の文字配列までのパス
112
112
  * @param {string} props.id - ユニークID
113
113
  * @param {boolean} [props.reverse] - 反転選択するか
114
114
  * @param {any} children - 子要素 (VNode / string / 配列など)
@@ -156,7 +156,7 @@ export const SelectButton = function (props, children) {
156
156
  * @template S
157
157
  * @param {Record<string, any>} props - props
158
158
  * @param {S} props.state - ステート
159
- * @param {string[]} props.keyNames - ステート内の文字までのパス
159
+ * @param {Keys_String} props.keyNames - ステート内の文字までのパス
160
160
  * @param {string} props.id - ユニークID
161
161
  * @param {boolean} [props.reverse] - 反転選択するか
162
162
  * @param {any} children - 子要素 (VNode / string / 配列など)
@@ -1,2 +1,6 @@
1
+ export type { Keys } from "./state";
1
2
  export { getValue, setValue, getLocalState, setLocalState, createLocalKey } from "./state";
3
+ export type { Keys_String, Keys_ArrayString } from "./component";
2
4
  export { el, concatAction, getClassList, deleteKeys, Route, SelectButton, OptionButton } from "./component";
5
+ export type { Keys_NavigatorItem, NavigatorItem, JsonEntry, NavigatorColumn } from "./navigator";
6
+ export { convertJsonToNavigatorItem, getParentItems, NavigatorFinder } from "./navigator";
@@ -1,2 +1,4 @@
1
+ // hyperapp-is / core / index.ts
1
2
  export { getValue, setValue, getLocalState, setLocalState, createLocalKey } from "./state";
2
3
  export { el, concatAction, getClassList, deleteKeys, Route, SelectButton, OptionButton } from "./component";
4
+ export { convertJsonToNavigatorItem, getParentItems, NavigatorFinder } from "./navigator";
@@ -0,0 +1,74 @@
1
+ import { VNode, Effect } from "hyperapp";
2
+ import { Keys_NavigatorItem } from "./state";
3
+ /**
4
+ * ツリー構造となるナビゲーションオブジェクト
5
+ *
6
+ * parent - 親アイテム
7
+ * name - 名前
8
+ * properties - プロパティオブジェクト
9
+ * children - 子アイテムリスト (undefinedのときはファイル)
10
+ * path - パス
11
+ * extension - 拡張情報
12
+ */
13
+ export interface NavigatorItem {
14
+ parent: NavigatorItem | null;
15
+ name: string;
16
+ properties?: Record<string, any>;
17
+ children?: NavigatorItem[];
18
+ path: string;
19
+ extension?: Record<string, any>;
20
+ }
21
+ /**
22
+ * getEntriesで返すオブジェクト
23
+ *
24
+ * name - 名前
25
+ * data - データ
26
+ * isNode - ディレクトリか
27
+ */
28
+ export interface JsonEntry<D> {
29
+ name: string;
30
+ data: D;
31
+ isNode: boolean;
32
+ }
33
+ /**
34
+ * ヘッダー名と値
35
+ */
36
+ export interface NavigatorColumn {
37
+ name: string;
38
+ val: (item: NavigatorItem) => any;
39
+ }
40
+ /**
41
+ * Json から NavigatorItem に変換
42
+ * getEntries の採用により、JSON の形を問わない
43
+ * extension により、任意情報を保存できる
44
+ */
45
+ export declare const convertJsonToNavigatorItem: <D>(props: {
46
+ parent: NavigatorItem | null;
47
+ name: string;
48
+ data: D;
49
+ getEntries: (data: D, depth: number) => JsonEntry<D>[];
50
+ isNode: boolean;
51
+ depth?: number;
52
+ extension?: (item: NavigatorItem, data: D, depth: number) => Record<string, any> | undefined;
53
+ }) => NavigatorItem;
54
+ /**
55
+ * NavigatorItem の親をリストで取得する
56
+ */
57
+ export declare const getParentItems: (item: NavigatorItem | undefined) => NavigatorItem[];
58
+ /**
59
+ * ナビゲーションファインダーコンポーネント
60
+ */
61
+ export declare const NavigatorFinder: <S>(props: {
62
+ state: S;
63
+ currentKeys: Keys_NavigatorItem;
64
+ columns?: (directory: NavigatorItem | undefined) => NavigatorColumn[];
65
+ maxItemsCount?: number;
66
+ itemClick?: (state: S, item: NavigatorItem) => S | [S, Effect<S>];
67
+ afterRender?: (props: {
68
+ state: S;
69
+ current?: NavigatorItem;
70
+ extension?: Record<string, any>;
71
+ }, vnode: VNode<S>) => VNode<S>;
72
+ extension?: Record<string, any>;
73
+ [key: string]: any;
74
+ }) => VNode<S>;
@@ -0,0 +1,195 @@
1
+ // hyperapp-is / core / navigator.ts
2
+ import { getValue, setValue } from "./state";
3
+ import { el, deleteKeys } from "./component";
4
+ /* element */
5
+ const div = el("div");
6
+ const table = el("table");
7
+ const thead = el("thead");
8
+ const tbody = el("tbody");
9
+ const tr = el("tr");
10
+ const th = el("th");
11
+ const td = el("td");
12
+ const ul = el("ul");
13
+ const ol = el("ol");
14
+ const li = el("li");
15
+ const button = el("button");
16
+ const input = el("input");
17
+ const span = el("span");
18
+ // ---------- ---------- ---------- ---------- ----------
19
+ // convertJsonToNavigatorItem
20
+ // ---------- ---------- ---------- ---------- ----------
21
+ /**
22
+ * Json から NavigatorItem に変換
23
+ * getEntries の採用により、JSON の形を問わない
24
+ * extension により、任意情報を保存できる
25
+ */
26
+ export const convertJsonToNavigatorItem = function (props) {
27
+ const { parent, name, data, getEntries, isNode, depth = 0, extension } = props;
28
+ const result = {
29
+ parent,
30
+ name,
31
+ path: parent ? parent.path + "/" + name : "/" + name
32
+ };
33
+ // 拡張情報
34
+ if (extension) {
35
+ const ext = extension(result, data, depth);
36
+ if (ext)
37
+ result.extension = ext;
38
+ }
39
+ const properties = {};
40
+ let hasProperty = false;
41
+ const children = [];
42
+ getEntries(data, depth).forEach(entry => {
43
+ const isProperty = typeof entry.data !== "object" || Array.isArray(entry.data);
44
+ // プロパティ
45
+ if (isProperty) {
46
+ properties[entry.name] = entry.data;
47
+ hasProperty = true;
48
+ // 子アイテム
49
+ }
50
+ else {
51
+ children.push(convertJsonToNavigatorItem({
52
+ parent: result,
53
+ name: entry.name,
54
+ data: entry.data,
55
+ getEntries,
56
+ isNode: entry.isNode,
57
+ depth: depth + 1,
58
+ extension
59
+ }));
60
+ }
61
+ });
62
+ if (hasProperty)
63
+ result.properties = properties;
64
+ if (isNode)
65
+ result.children = children; // ファイルのときは undefined
66
+ return result;
67
+ };
68
+ // ---------- ---------- ---------- ---------- ----------
69
+ // getParentItems
70
+ // ---------- ---------- ---------- ---------- ----------
71
+ /**
72
+ * NavigatorItem の親をリストで取得する
73
+ */
74
+ export const getParentItems = (item) => {
75
+ if (!item)
76
+ return [];
77
+ const result = [];
78
+ let cd = item.parent;
79
+ while (cd) {
80
+ result.push(cd);
81
+ cd = cd.parent;
82
+ }
83
+ return result.reverse();
84
+ };
85
+ // ---------- ---------- ---------- ---------- ----------
86
+ // NavigatorFinder Component
87
+ // ---------- ---------- ---------- ---------- ----------
88
+ /**
89
+ * ナビゲーションファインダーコンポーネント
90
+ */
91
+ export const NavigatorFinder = function (props) {
92
+ var _a, _b;
93
+ const { state, currentKeys, maxItemsCount = 0, itemClick, afterRender, extension } = props;
94
+ const current = getValue(state, currentKeys, undefined);
95
+ // createColumns
96
+ const createColumns = (_a = props.columns) !== null && _a !== void 0 ? _a : ((directory) => {
97
+ const result = [];
98
+ if (!directory)
99
+ return result;
100
+ result.push({
101
+ name: "name",
102
+ val: (item) => item.name
103
+ });
104
+ // get properties
105
+ const children = directory.children;
106
+ if (children) {
107
+ // get names
108
+ const names = [];
109
+ // get properties
110
+ // 子アイテムのプロパティをすべて確認して抽出しています
111
+ children.forEach(child => {
112
+ if (!child.children)
113
+ return;
114
+ if (child.properties) {
115
+ Object.keys(child.properties).forEach(key => names.push(key));
116
+ }
117
+ });
118
+ // add NavigatorColumn
119
+ Array.from(new Set(names)).forEach(name => {
120
+ result.push({
121
+ name,
122
+ val: (item) => {
123
+ var _a;
124
+ const p = item.properties;
125
+ return p
126
+ ? (_a = p[name]) !== null && _a !== void 0 ? _a : ""
127
+ : "";
128
+ }
129
+ });
130
+ });
131
+ }
132
+ return result;
133
+ }); // end createColumns
134
+ const columns = createColumns(current);
135
+ // parentItems
136
+ const parentItems = getParentItems(current);
137
+ if (current)
138
+ parentItems.push(current);
139
+ // getItems
140
+ const getItems = (item) => {
141
+ if (!item || item.children === undefined)
142
+ return [];
143
+ const count = maxItemsCount === 0
144
+ ? item.children.length
145
+ : Math.min(maxItemsCount, item.children.length);
146
+ return item.children.slice(0, count);
147
+ }; // end getItems
148
+ // items
149
+ const items = getItems(current);
150
+ const count = current
151
+ ? (_b = current.children) === null || _b === void 0 ? void 0 : _b.length
152
+ : 0;
153
+ // action_parentClick
154
+ const action_parentClick = (state, item) => {
155
+ return setValue(state, currentKeys, item);
156
+ };
157
+ // action_itemClick
158
+ const action_itemClick = (state, item) => {
159
+ // 子アイテムがすべてプロパティのときは移動しない
160
+ const children = item.children;
161
+ if (!children)
162
+ return state;
163
+ if (!children.some(child => typeof child === "object" && !Array.isArray(child)))
164
+ return state;
165
+ return setValue(state, currentKeys, item);
166
+ };
167
+ // VNode
168
+ const vnode = div({
169
+ ...deleteKeys(props, "state", "currentKeys", "columns", "itemClick", "afterRender", "extension")
170
+ },
171
+ // toolBar
172
+ div({
173
+ class: "toolBar"
174
+ }, "toolBar (未実装)"),
175
+ // parentItems
176
+ ol({}, parentItems.map(parent => li({
177
+ key: parent.path,
178
+ onclick: [action_parentClick, parent]
179
+ }, parent.name))),
180
+ // items
181
+ table({}, thead({}, tr({}, columns.map(col => th({}, col.name)))), tbody({}, items.map(item => tr({
182
+ key: item.path,
183
+ onclick: item.children === undefined
184
+ ? itemClick ? [itemClick, item] : undefined
185
+ : [action_itemClick, item]
186
+ }, columns.map(col => td({
187
+ title: col.val(item)
188
+ }, col.val(item))))))),
189
+ // statusBar
190
+ div({
191
+ class: "statusBar"
192
+ }, `items ${items.length} / ${count}`));
193
+ // afterRender
194
+ return afterRender ? afterRender({ state, current, extension }, vnode) : vnode;
195
+ };
@@ -1,24 +1,35 @@
1
+ /**
2
+ * ステートへのパス
3
+ * 参照する値の型がわかりやすいよう、複数パターンをここで集約
4
+ */
5
+ export type Keys = readonly string[];
6
+ export type Keys_String = Keys;
7
+ export type Keys_ArrayString = Keys;
8
+ export type Keys_Number = Keys;
9
+ export type Keys_ArrayNumber = Keys;
10
+ export type Keys_ArrayRAFTask = Keys;
11
+ export type Keys_NavigatorItem = Keys;
1
12
  /**
2
13
  * パスを辿って、ステートから値を取得する
3
14
  *
4
15
  * @template S
5
16
  * @template D
6
- * @param {S} state - ステート
7
- * @param {string[]} keyNames - 値までのパス
8
- * @param {D} def - デフォルト値
9
- * @returns {D} - 型保証は呼び出し側の責任
17
+ * @param {S} state - ステート
18
+ * @param {Keys} keyNames - 値までのパス
19
+ * @param {D} def - デフォルト値
20
+ * @returns {D} - 型保証は呼び出し側の責任
10
21
  */
11
- export declare const getValue: <S, D>(state: S, keyNames: string[], def: D) => D;
22
+ export declare const getValue: <S, D>(state: S, keyNames: Keys, def: D) => D;
12
23
  /**
13
24
  * パスを辿って、ステートに値を設定して返す
14
25
  *
15
26
  * @template S
16
- * @param {S} state - ステート
17
- * @param {string[]} keyNames - 値までのパス
18
- * @param {any} value - 設定する値
27
+ * @param {S} state - ステート
28
+ * @param {Keys} keyNames - 値までのパス
29
+ * @param {any} value - 設定する値
19
30
  * @returns {S}
20
31
  */
21
- export declare const setValue: <S>(state: S, keyNames: string[], value: any) => S;
32
+ export declare const setValue: <S>(state: S, keyNames: Keys, value: any) => S;
22
33
  /**
23
34
  * IDからユニーク文字列を作成する
24
35
  *
@@ -35,11 +46,7 @@ export declare const createLocalKey: (id: string) => string;
35
46
  * @param {Record<string, any>} def - 初期値
36
47
  * @returns {Record<string, any>}
37
48
  */
38
- export declare const getLocalState: <S>(state: S, id: string, def: {
39
- [key: string]: any;
40
- }) => {
41
- [key: string]: any;
42
- };
49
+ export declare const getLocalState: <S>(state: S, id: string, def: Record<string, any>) => Record<string, any>;
43
50
  /**
44
51
  * ローカルステートを更新してステートを返す
45
52
  *
@@ -49,6 +56,4 @@ export declare const getLocalState: <S>(state: S, id: string, def: {
49
56
  * @param {Record<string, any>} value - 設定するローカルステート
50
57
  * @returns {S}
51
58
  */
52
- export declare const setLocalState: <S>(state: S, id: string, value: {
53
- [key: string]: any;
54
- }) => S;
59
+ export declare const setLocalState: <S>(state: S, id: string, value: Record<string, any>) => S;
@@ -1,4 +1,4 @@
1
- // hyperapp-ut / core / state.ts
1
+ // hyperapp-is / core / state.ts
2
2
  // ---------- ---------- ---------- ---------- ----------
3
3
  // getValue
4
4
  // ---------- ---------- ---------- ---------- ----------
@@ -7,10 +7,10 @@
7
7
  *
8
8
  * @template S
9
9
  * @template D
10
- * @param {S} state - ステート
11
- * @param {string[]} keyNames - 値までのパス
12
- * @param {D} def - デフォルト値
13
- * @returns {D} - 型保証は呼び出し側の責任
10
+ * @param {S} state - ステート
11
+ * @param {Keys} keyNames - 値までのパス
12
+ * @param {D} def - デフォルト値
13
+ * @returns {D} - 型保証は呼び出し側の責任
14
14
  */
15
15
  export const getValue = function (state, keyNames, def) {
16
16
  let result = state;
@@ -34,9 +34,9 @@ export const getValue = function (state, keyNames, def) {
34
34
  * パスを辿って、ステートに値を設定して返す
35
35
  *
36
36
  * @template S
37
- * @param {S} state - ステート
38
- * @param {string[]} keyNames - 値までのパス
39
- * @param {any} value - 設定する値
37
+ * @param {S} state - ステート
38
+ * @param {Keys} keyNames - 値までのパス
39
+ * @param {any} value - 設定する値
40
40
  * @returns {S}
41
41
  */
42
42
  export const setValue = function (state, keyNames, value) {
@@ -1,2 +1,2 @@
1
1
  export type { ScrollMargin, MatrixState } from "./utils";
2
- export { getScrollMargin, getMatrixState, marquee } from "./utils";
2
+ export { getScrollMargin, getMatrixState } from "./utils";
@@ -1 +1,2 @@
1
- export { getScrollMargin, getMatrixState, marquee } from "./utils";
1
+ // hyperapp-is / dom / index.ts
2
+ export { getScrollMargin, getMatrixState } from "./utils";
@@ -47,22 +47,3 @@ export interface MatrixState {
47
47
  * @returns {MatrixState}
48
48
  */
49
49
  export declare const getMatrixState: (dom: HTMLElement) => MatrixState | null;
50
- /**
51
- * Carousel 風に DOM が流れるアニメーションを実行する
52
- *
53
- * @param {Object} props - props
54
- * @param {HTMLElement} props.element - DOM
55
- * @param {number} props.duration - 実行時間 (ms)
56
- * @param {number} props.interval - 待機時間 (ms)
57
- * @param {(t: number) => number} [props.easing] - easing 関数
58
- * @returns {{start: () => void, stop: () => void}}
59
- */
60
- export declare const marquee: <S>(props: {
61
- element: HTMLElement;
62
- duration: number;
63
- interval: number;
64
- easing?: (t: number) => number;
65
- }) => {
66
- start: () => void;
67
- stop: () => void;
68
- };
@@ -1,4 +1,4 @@
1
- // hyperapp-ui / dom / utils.ts
1
+ // hyperapp-is / dom / utils.ts
2
2
  // ---------- ---------- ---------- ---------- ----------
3
3
  // getScrollMargin
4
4
  // ---------- ---------- ---------- ---------- ----------
@@ -73,87 +73,3 @@ export const getMatrixState = (dom) => {
73
73
  }
74
74
  };
75
75
  };
76
- // ---------- ---------- ---------- ---------- ----------
77
- // marquee
78
- // ---------- ---------- ---------- ---------- ----------
79
- /**
80
- * Carousel 風に DOM が流れるアニメーションを実行する
81
- *
82
- * @param {Object} props - props
83
- * @param {HTMLElement} props.element - DOM
84
- * @param {number} props.duration - 実行時間 (ms)
85
- * @param {number} props.interval - 待機時間 (ms)
86
- * @param {(t: number) => number} [props.easing] - easing 関数
87
- * @returns {{start: () => void, stop: () => void}}
88
- */
89
- export const marquee = function (props) {
90
- const { element, duration, interval, easing = (t) => t } = props;
91
- // function calcWidth
92
- const calcWidth = () => {
93
- const children = Array.from(element.children);
94
- return !children || children.length < 2
95
- ? 0
96
- : children[1].offsetLeft - children[0].offsetLeft;
97
- };
98
- // variable
99
- let rID = 0;
100
- let timerID = 0;
101
- let startTime = 0;
102
- let width = 0;
103
- // requestAnimationFrame callback
104
- const action = (now) => {
105
- // set startTime
106
- if (startTime === 0)
107
- startTime = now;
108
- // get progress
109
- const progress = Math.min((now - startTime) / Math.max(1, duration));
110
- // set property
111
- element.style.transform = `translateX(${-easing(progress) * width}px)`;
112
- // next
113
- if (progress < 1) {
114
- rID = requestAnimationFrame(action);
115
- return;
116
- }
117
- // reset property
118
- element.style.transform = `translateX(0px)`;
119
- // set children
120
- const firstChild = element.children[0];
121
- if (!firstChild)
122
- return;
123
- // loop
124
- element.appendChild(firstChild);
125
- // loop
126
- timerID = window.setTimeout(() => {
127
- startTime = 0;
128
- rID = requestAnimationFrame(action);
129
- }, interval);
130
- };
131
- // result
132
- return {
133
- start: () => {
134
- // 二重起動防止
135
- if (rID !== 0)
136
- return;
137
- // get width
138
- width = calcWidth();
139
- if (width === 0)
140
- return;
141
- // set gpu layer
142
- element.style.willChange = "transform";
143
- // start animation
144
- rID = requestAnimationFrame(action);
145
- },
146
- stop: () => {
147
- // cancel animation
148
- cancelAnimationFrame(rID);
149
- // stop timer
150
- clearTimeout(timerID);
151
- // clear gpy layer
152
- element.style.willChange = "";
153
- element.style.transform = "";
154
- // clear ID
155
- rID = 0;
156
- timerID = 0;
157
- }
158
- };
159
- };
@@ -1,7 +1,14 @@
1
- export { getValue, setValue, getLocalState, setLocalState, createLocalKey, el, concatAction, getClassList, deleteKeys, Route, SelectButton, OptionButton } from "./core";
2
- export type { InternalEffect, RAFEvent, CSSProperty } from "./animation";
3
- export { RAFTask, subscription_RAFManager, progress_easing, createUnits, createRAFProperties, effect_RAFProperties } from "./animation";
4
- export type { CarouselState, CarouselController } from "./animationView";
5
- export { Carousel, effect_InitCarousel } from "./animationView";
6
- export type { ScrollMargin, MatrixState } from "./dom";
7
- export { getScrollMargin, getMatrixState, marquee } from "./dom";
1
+ export type { Keys, Keys_String, Keys_ArrayString, Keys_Number, Keys_ArrayNumber, Keys_ArrayRAFTask, Keys_NavigatorItem, } from "./core/state";
2
+ export type { NavigatorItem, JsonEntry, NavigatorColumn } from "./core/navigator";
3
+ export { getValue, setValue, getLocalState, setLocalState, createLocalKey } from "./core/state";
4
+ export { el, concatAction, getClassList, deleteKeys, Route, SelectButton, OptionButton } from "./core/component";
5
+ export { convertJsonToNavigatorItem, getParentItems, NavigatorFinder } from "./core/navigator";
6
+ export type { InternalEffect, RAFEvent } from "./animation/raf";
7
+ export type { CSSProperty } from "./animation/properties";
8
+ export { RAFTask, subscription_RAFManager } from "./animation/raf";
9
+ export { progress_easing } from "./animation/easing";
10
+ export { createUnits, createRAFProperties, effect_RAFProperties } from "./animation/properties";
11
+ export type { CarouselState, CarouselController } from "./animationView/carousel";
12
+ export { Carousel, effect_InitCarousel } from "./animationView/carousel";
13
+ export type { ScrollMargin, MatrixState } from "./dom/utils";
14
+ export { getScrollMargin, getMatrixState } from "./dom/utils";
@@ -1,5 +1,9 @@
1
- // core
2
- export { getValue, setValue, getLocalState, setLocalState, createLocalKey, el, concatAction, getClassList, deleteKeys, Route, SelectButton, OptionButton } from "./core";
3
- export { RAFTask, subscription_RAFManager, progress_easing, createUnits, createRAFProperties, effect_RAFProperties } from "./animation";
4
- export { Carousel, effect_InitCarousel } from "./animationView";
5
- export { getScrollMargin, getMatrixState, marquee } from "./dom";
1
+ // hyperapp-is / index.ts
2
+ export { getValue, setValue, getLocalState, setLocalState, createLocalKey } from "./core/state";
3
+ export { el, concatAction, getClassList, deleteKeys, Route, SelectButton, OptionButton } from "./core/component";
4
+ export { convertJsonToNavigatorItem, getParentItems, NavigatorFinder } from "./core/navigator";
5
+ export { RAFTask, subscription_RAFManager } from "./animation/raf";
6
+ export { progress_easing } from "./animation/easing";
7
+ export { createUnits, createRAFProperties, effect_RAFProperties } from "./animation/properties";
8
+ export { Carousel, effect_InitCarousel } from "./animationView/carousel";
9
+ export { getScrollMargin, getMatrixState } from "./dom/utils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperapp-is",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "UI foundation library for Hyperapp by is4416",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,5 +37,8 @@
37
37
  "devDependencies": {
38
38
  "typescript": "^5.0.0",
39
39
  "vite": "^7.3.0"
40
+ },
41
+ "dependencies": {
42
+ "marked": "^17.0.4"
40
43
  }
41
44
  }