extract rules from content
This commit is contained in:
@@ -88,6 +88,9 @@ export class UmbStylesheetWorkspaceContext extends UmbWorkspaceContext<UmbStyles
|
||||
}
|
||||
|
||||
async sendContentGetRules() {
|
||||
|
||||
if (!this.getData()?.content) return Promise.reject('There is no content to extract rules from...');
|
||||
|
||||
const requestBody = {
|
||||
content: this.getData()?.content,
|
||||
};
|
||||
|
||||
@@ -65,6 +65,11 @@ export class UmbStylesheetWorkspaceViewCodeEditorElement extends UmbLitElement {
|
||||
@input=${this.#onCodeEditorInput}></umb-code-editor>`;
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback();
|
||||
console.log('disconnected');
|
||||
}
|
||||
|
||||
render() {
|
||||
return html` <uui-box>
|
||||
<div slot="header" id="code-editor-menu-container"></div>
|
||||
|
||||
@@ -49,9 +49,9 @@ export class UmbStylesheetWorkspaceViewRichTextEditorElement extends UmbLitEleme
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
//tODO: should this be called something else here?
|
||||
this.consumeContext(UMB_WORKSPACE_CONTEXT, (workspaceContext) => {
|
||||
this.#context = workspaceContext as UmbStylesheetWorkspaceContext;
|
||||
this.#context.sendContentGetRules();
|
||||
|
||||
this.observe(this.#context.content, (content) => {
|
||||
this._content = content ?? '';
|
||||
@@ -79,6 +79,8 @@ export class UmbStylesheetWorkspaceViewRichTextEditorElement extends UmbLitEleme
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
#openModal = (rule: RichTextRuleModel | null = null) => {
|
||||
if (!this._modalContext) throw new Error('Modal context not found');
|
||||
this.#currentlyEditing = rule;
|
||||
|
||||
Reference in New Issue
Block a user