This repository was archived by the owner on Sep 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 area,
77 onsave,
88 }: {
9- area? : co .loaded <typeof Area , { title: true ; notes: true }>;
10- onsave: (area : Area ) => void ;
9+ area? : co .loaded <typeof Area , { title: true ; notes: true ; projects : true }>;
10+ onsave: (area : co . loaded < typeof Area , { title : true ; notes : true ; projects : true }> ) => void ;
1111 } = $props ();
1212
1313 let draftTitle = $state (area ?.title ?.toString () || ' ' );
1717 e .preventDefault ();
1818
1919 if (area ) {
20- area .title .applyDiff (draftTitle );
21- area .notes .applyDiff (draftNotes );
20+ area .title .$jazz . applyDiff (draftTitle );
21+ area .notes .$jazz . applyDiff (draftNotes );
2222 onsave (area );
2323 } else {
2424 onsave (
Original file line number Diff line number Diff line change 1212 placeholder =" Kermit the Frog"
1313 type =" text"
1414 value ={profile .name }
15- oninput ={(ev ) => ( profile .name = ev .currentTarget .value )}
15+ oninput ={(ev ) => profile .$jazz . set ( ' name' , ev .currentTarget .value )}
1616 />
1717 </label >
1818</form >
Original file line number Diff line number Diff line change 7676 < / div >
7777 {:else }
7878 < ol class = " flex flex-col gap-4" >
79- {#each root .areas .filter ((area ) => ! area .archived ) as area (area .id )}
79+ {#each root .areas .filter ((area ) => ! area .archived ) as area (area .$jazz . id )}
8080 {@render link (
81- ` /area/${area .id } ` ,
81+ ` /area/${area .$jazz . id } ` ,
8282 area .title ?.toString (),
83- page .route .id === ` /area/${area .id } ` ,
83+ page .route .id === ` /area/${area .$jazz . id } ` ,
8484 Grid2x2 ,
8585 ' text-surface-300-700' ,
8686 area .projects .length > 0 ? area .projects .length .toString () : ' ' ,
121121>
122122 < QuickAdd
123123 onadd = {(task) => {
124- if (root ?.inbox ) root .inbox .push (task );
124+ if (root ?.inbox ) root .inbox .$jazz . push (task );
125125 quickAdd .close ();
126126 }}
127127 / >
134134>
135135 < AreaForm
136136 onsave = {(area) => {
137- if (root ?.areas ) root .areas .push (area );
137+ if (root ?.areas ) root .areas .$jazz . push (area );
138138 newArea .close ();
139139 }}
140140 / >
Original file line number Diff line number Diff line change 104104 bind:value ={
105105 () => task .title ?.toString (),
106106 (val ) => {
107- if (val ) task .title ?.applyDiff (val );
107+ if (val ) task .title ?.$jazz . applyDiff (val );
108108 }
109109 }
110110 />
140140 bind:value ={waitDraft }
141141 onblur ={parseAndSave (
142142 waitDraft ,
143- (v ) => ( task .wait = v ),
143+ (v ) => task .$jazz . set ( ' wait' , v ),
144144 () => (waitDraft = task .wait ?.toLocaleString () || ' ' ),
145145 )}
146146 />
155155 bind:value ={dueDraft }
156156 onblur ={parseAndSave (
157157 dueDraft ,
158- (v ) => ( task .due = v ),
158+ (v ) => task .$jazz . set ( ' due' , v ),
159159 () => (dueDraft = task .due ?.toLocaleString () || ' ' ),
160160 )}
161161 />
Original file line number Diff line number Diff line change 77 </script >
88
99<ol class =" flex flex-col gap-2" >
10- {#each list as task (task ?.id )}
10+ {#each list as task (task ?.$jazz . id )}
1111 {#if task }
1212 <li >
1313 <SingleTask {task } />
Original file line number Diff line number Diff line change @@ -17,31 +17,31 @@ export const Account = co
1717 if ( account . root === undefined ) {
1818 const group = Group . create ( ) ;
1919
20- account . root = Root . create (
21- {
22- inbox : [ ] ,
23- areas : [ ] ,
24- } ,
25- group ,
26- ) ;
20+ account . $jazz . set ( " root" , Root . create (
21+ {
22+ inbox : [ ] ,
23+ areas : [ ] ,
24+ } ,
25+ group ,
26+ ) ) ;
2727 }
2828
2929 if ( account . root && account . root . areas === undefined ) {
3030 const group = Group . create ( ) ;
31- group . addMember ( account . root . _owner , 'admin' ) ;
31+ group . addMember ( account . root . $jazz . owner , 'admin' ) ;
3232
33- account . root . areas = Root . shape . areas . create ( [ ] , group ) ;
33+ account . root . $jazz . set ( " areas" , Root . shape . areas . create ( [ ] , group ) ) ;
3434 }
3535
3636 if ( ! account . profile ) {
3737 const group = Group . create ( ) ;
3838 group . addMember ( 'everyone' , 'reader' ) ;
3939
40- account . profile = Profile . create (
41- {
42- name : '' ,
43- } ,
44- group ,
45- ) ;
40+ account . $jazz . set ( " profile" , Profile . create (
41+ {
42+ name : '' ,
43+ } ,
44+ group ,
45+ ) ) ;
4646 }
4747 } ) ;
Original file line number Diff line number Diff line change 4141
4242 <div id ={optionsId } class ="rounded-base p-2" {@attach popover }>
4343 {#if ! area .archived }
44- <button class ="btn-primary btn" onclick ={() => ( area .archived = new Date ())}>
44+ <button class ="btn-primary btn" onclick ={() => area .$jazz . set ( ' archived' , new Date ())}>
4545 <Archive class =" h-8 w-8 text-error-500" />
4646 Archive {area .title }
4747 </button >
4848 {:else }
49- <button class ="btn-primary btn" onclick ={() => ( area .archived = undefined )}>
49+ <button class ="btn-primary btn" onclick ={() => area .$jazz . delete ( ' archived' )}>
5050 <ArchiveRestore class =" h-8 w-8 text-success-500" />
5151 Restore {area .title }
5252 </button >
You can’t perform that action at this time.
0 commit comments