@eduboxpro/studio 0.1.32 → 0.1.34
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/fesm2022/eduboxpro-studio.mjs +84 -2
- package/fesm2022/eduboxpro-studio.mjs.map +1 -1
- package/index.d.ts +315 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, signal, effect, Injectable, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, input, computed, ChangeDetectionStrategy, Component, output, PLATFORM_ID, ElementRef, contentChild, viewChild, forwardRef, DOCUMENT as DOCUMENT$1, DestroyRef, Injector, model, afterNextRender, HostListener, Renderer2, TemplateRef, ContentChild, Input, Directive, contentChildren } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, signal, effect, Injectable, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, input, computed, ChangeDetectionStrategy, Component, untracked, output, PLATFORM_ID, ElementRef, contentChild, viewChild, forwardRef, DOCUMENT as DOCUMENT$1, DestroyRef, Injector, model, afterNextRender, HostListener, Renderer2, TemplateRef, ContentChild, Input, Directive, contentChildren } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, CommonModule, isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import * as LucideIcons from 'lucide-angular';
|
|
@@ -630,6 +630,54 @@ function withConfigDefault(inputSignal, configSignal, defaultValue) {
|
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
+
class SignalStore {
|
|
634
|
+
state;
|
|
635
|
+
constructor(initialState) {
|
|
636
|
+
this.state = signal(initialState, ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
637
|
+
}
|
|
638
|
+
get$() {
|
|
639
|
+
return this.state.asReadonly();
|
|
640
|
+
}
|
|
641
|
+
snapshot() {
|
|
642
|
+
return this.state();
|
|
643
|
+
}
|
|
644
|
+
setState(newState) {
|
|
645
|
+
this.state.set(newState);
|
|
646
|
+
}
|
|
647
|
+
updateState(updateFn) {
|
|
648
|
+
this.state.update(updateFn);
|
|
649
|
+
}
|
|
650
|
+
patchState(partial) {
|
|
651
|
+
this.state.update(state => ({ ...state, ...partial }));
|
|
652
|
+
}
|
|
653
|
+
resetState(initialState) {
|
|
654
|
+
this.setState(initialState);
|
|
655
|
+
}
|
|
656
|
+
select(selector) {
|
|
657
|
+
return computed(() => selector(this.state()));
|
|
658
|
+
}
|
|
659
|
+
onStateChange(callback) {
|
|
660
|
+
effect(() => callback(this.state()));
|
|
661
|
+
}
|
|
662
|
+
onStateChangeWithPrevious(callback) {
|
|
663
|
+
let previous = untracked(() => this.state());
|
|
664
|
+
effect(() => {
|
|
665
|
+
const current = this.state();
|
|
666
|
+
callback(current, previous);
|
|
667
|
+
previous = current;
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
batchUpdate(updates) {
|
|
671
|
+
this.updateState(state => {
|
|
672
|
+
let newState = { ...state };
|
|
673
|
+
updates.forEach(update => {
|
|
674
|
+
newState = { ...newState, ...update };
|
|
675
|
+
});
|
|
676
|
+
return newState;
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
633
681
|
/**
|
|
634
682
|
* @eduboxpro/studio - Utilities
|
|
635
683
|
*
|
|
@@ -7910,6 +7958,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
7910
7958
|
args: ['paste', ['$event']]
|
|
7911
7959
|
}] } });
|
|
7912
7960
|
|
|
7961
|
+
/**
|
|
7962
|
+
* Block System Types and Interfaces
|
|
7963
|
+
* Core models for dynamic page rendering in EduBox
|
|
7964
|
+
*
|
|
7965
|
+
* @packageDocumentation
|
|
7966
|
+
*/
|
|
7967
|
+
// ============================================
|
|
7968
|
+
// Type Guards
|
|
7969
|
+
// ============================================
|
|
7970
|
+
function isLayoutBlock(block) {
|
|
7971
|
+
return ['flex-container', 'grid-container', 'div', 'card', 'section'].includes(block.type);
|
|
7972
|
+
}
|
|
7973
|
+
function isContentBlock(block) {
|
|
7974
|
+
return ['text', 'image', 'video', 'html', 'code', 'list'].includes(block.type);
|
|
7975
|
+
}
|
|
7976
|
+
function isInteractiveBlock(block) {
|
|
7977
|
+
return ['button', 'alert', 'badge', 'link', 'slider', 'tabs', 'accordion'].includes(block.type);
|
|
7978
|
+
}
|
|
7979
|
+
function isFormBlock(block) {
|
|
7980
|
+
return ['form', 'input', 'textarea', 'select', 'checkbox'].includes(block.type);
|
|
7981
|
+
}
|
|
7982
|
+
function isStudioBlock(block) {
|
|
7983
|
+
return block.type.startsWith('studio-');
|
|
7984
|
+
}
|
|
7985
|
+
function hasChildren(block) {
|
|
7986
|
+
return Array.isArray(block.children) && block.children.length > 0;
|
|
7987
|
+
}
|
|
7988
|
+
|
|
7989
|
+
/**
|
|
7990
|
+
* @eduboxpro/studio - Models
|
|
7991
|
+
*
|
|
7992
|
+
* Type definitions and interfaces for the block system
|
|
7993
|
+
*/
|
|
7994
|
+
|
|
7913
7995
|
/**
|
|
7914
7996
|
* Public API Surface of @eduboxpro/studio
|
|
7915
7997
|
*/
|
|
@@ -7921,5 +8003,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
7921
8003
|
* Generated bundle index. Do not edit.
|
|
7922
8004
|
*/
|
|
7923
8005
|
|
|
7924
|
-
export { BadgeComponent, BadgeWrapperComponent, BottomNavigationComponent, ButtonComponent, ButtonGroupComponent, ButtonToggleGroupComponent, COUNTRY_OPTIONS, CardComponent, ChatComponent, ChatInputComponent, ChatMessageComponent, CheckboxComponent, ColorPickerCompactComponent, ColorPickerComponent, ConfirmDialogComponent, ConfirmDialogService, DEFAULT_COLOR_PRESETS, DrawerComponent, DrawerService, DropdownComponent, IconComponent, InputComponent, InspectorComponent, MASK_PRESETS, MaskDirective, MaskEngine, MenuComponent, ModalComponent, NavbarComponent, PaginationComponent, PhoneInputComponent, PopoverComponent, RadioButtonComponent, STUDIO_CONFIG, SelectComponent, SidebarComponent, StudioConfigService, SwitchComponent, TableColumnDirective, TableComponent, TabsComponent, TextareaComponent, ThemeSwitchComponent, ToastComponent, ToastService, TooltipComponent, classNames, isSafeUrl, loadGoogleFont, loadGoogleFonts, provideStudioConfig, provideStudioIcons, sanitizeUrl, withConfigDefault };
|
|
8006
|
+
export { BadgeComponent, BadgeWrapperComponent, BottomNavigationComponent, ButtonComponent, ButtonGroupComponent, ButtonToggleGroupComponent, COUNTRY_OPTIONS, CardComponent, ChatComponent, ChatInputComponent, ChatMessageComponent, CheckboxComponent, ColorPickerCompactComponent, ColorPickerComponent, ConfirmDialogComponent, ConfirmDialogService, DEFAULT_COLOR_PRESETS, DrawerComponent, DrawerService, DropdownComponent, IconComponent, InputComponent, InspectorComponent, MASK_PRESETS, MaskDirective, MaskEngine, MenuComponent, ModalComponent, NavbarComponent, PaginationComponent, PhoneInputComponent, PopoverComponent, RadioButtonComponent, STUDIO_CONFIG, SelectComponent, SidebarComponent, SignalStore, StudioConfigService, SwitchComponent, TableColumnDirective, TableComponent, TabsComponent, TextareaComponent, ThemeSwitchComponent, ToastComponent, ToastService, TooltipComponent, classNames, hasChildren, isContentBlock, isFormBlock, isInteractiveBlock, isLayoutBlock, isSafeUrl, isStudioBlock, loadGoogleFont, loadGoogleFonts, provideStudioConfig, provideStudioIcons, sanitizeUrl, withConfigDefault };
|
|
7925
8007
|
//# sourceMappingURL=eduboxpro-studio.mjs.map
|