feat: CodeMirror integration and bug fixes
This commit addresses several issues related to the migration from TipTap to CodeMirror:
- **CodeMirror Initialization Fixes:**
- Resolved 'Unrecognized extension value' errors by refactoring to explicitly import individual CodeMirror extensions instead of relying on . This ensures proper singleton usage and prevents module duplication issues.
- Updated and to utilize these individual extensions.
- **Text Wrapping Enabled:**
- Added to the extensions in and to enable text wrapping in the CodeMirror editors.
- **Content Saving Fixes:**
- Corrected content binding for CodeMirror editor instances in various IDAA components:
- (description, location_text, attend_text)
- (content, notes)
- (content)
- (description, notes)
- (description, notes)
- Ensured that the prop of is correctly bound to the respective state variables in the parent components, and these state variables are initialized with existing content.
- **Save Button Enablement:**
- Fixed an issue in where the Save button was not enabling on content changes. The logic now directly compares the and with the original object's content, ensuring reactivity.
This commit is contained in:
@@ -57,15 +57,15 @@
|
||||
|
||||
let prom_api__event_obj: any = $state();
|
||||
|
||||
let description_new_html = $state('');
|
||||
let description_new_html = $state($idaa_slct.event_obj?.description ?? '');
|
||||
let description_changed = $state(false);
|
||||
let location_text_new_html = $state('');
|
||||
let location_text_new_html = $state($idaa_slct.event_obj?.location_text ?? '');
|
||||
let location_text_changed = $state(false);
|
||||
let attend_text_new_html = $state('');
|
||||
let attend_text_new_html = $state($idaa_slct.event_obj?.attend_text ?? '');
|
||||
let attend_text_changed = $state(false);
|
||||
let recurring_text_new_html = $state('');
|
||||
let recurring_text_new_html = $state($idaa_slct.event_obj?.recurring_text ?? '');
|
||||
let recurring_text_changed = $state(false);
|
||||
let notes_new_html = $state('');
|
||||
let notes_new_html = $state($idaa_slct.event_obj?.notes ?? '');
|
||||
let notes_changed = $state(false);
|
||||
|
||||
let disable_submit_btn = $state(true);
|
||||
@@ -933,7 +933,7 @@
|
||||
<!-- <textarea name="description" id="description" class="ae_value event__description tinymce_editor editor_basic textarea" rows="5" cols="70" bind:value={$idaa_slct.event_obj.description} ></textarea> -->
|
||||
|
||||
<Tiptap_editor
|
||||
html_text={$idaa_slct.event_obj?.description}
|
||||
bind:html_text={description_new_html}
|
||||
classes="preset-tonal-surface hover:preset-filled-surface-100-900 font-mono font-normal"
|
||||
placeholder="A short description or overview of this recovery meeting"
|
||||
/>
|
||||
@@ -1311,7 +1311,7 @@
|
||||
</span>
|
||||
<!-- <textarea class="ae_value event__location_text tinymce_editor editor_less_100 textarea" id="location_text" name="location_text" placeholder="Additional information about the meeting location" rows="2" cols="70" bind:value={$idaa_slct.event_obj.location_text}></textarea> -->
|
||||
<Tiptap_editor
|
||||
html_text={$idaa_slct.event_obj?.location_text}
|
||||
bind:html_text={location_text_new_html}
|
||||
classes="preset-tonal-surface hover:preset-filled-surface-100-900"
|
||||
placeholder="Additional information about the meeting location"
|
||||
/>
|
||||
@@ -1780,7 +1780,7 @@
|
||||
</span>
|
||||
<!-- <textarea class="ae_value event__attend_text tinymce_editor editor_less_100 textarea" id="attend_text" name="attend_text" placeholder="Additional information on how to attend or join the meeting" rows="2" cols="70" value={$lq__event_obj?.attend_text ?? ''}></textarea> -->
|
||||
<Tiptap_editor
|
||||
html_text={$idaa_slct.event_obj?.attend_text}
|
||||
bind:html_text={attend_text_new_html}
|
||||
classes="preset-tonal-surface hover:preset-filled-surface-100-900"
|
||||
placeholder="Additional information on how to attend or join the meeting"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user