ngx-blocks-studio 0.1.1 → 0.2.1
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Type, Injector, Signal, ViewContainerRef, ComponentRef } from '@angular/core';
|
|
2
|
+
import { Type, Injector, Signal, ViewContainerRef, ComponentRef, WritableSignal } from '@angular/core';
|
|
3
3
|
import { CanActivateFn, RunGuardsAndResolvers } from '@angular/router';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -306,7 +306,7 @@ declare class RouteLoader {
|
|
|
306
306
|
private loadComponent;
|
|
307
307
|
private getGuard;
|
|
308
308
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RouteLoader, never>;
|
|
309
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
309
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
interface CurrentInstance {
|
|
@@ -380,7 +380,7 @@ declare class BlockRegistryService {
|
|
|
380
380
|
getRegistryForScope(scopeKey: string): BlockRegistry | null;
|
|
381
381
|
getParentScopeKey(scopeKey: string): string | null;
|
|
382
382
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BlockRegistryService, never>;
|
|
383
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
383
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
/**
|
|
@@ -507,8 +507,9 @@ declare function parseRefPath(refPath: string): ParsedRefPath;
|
|
|
507
507
|
declare function extractReadonlyRefs(template: string): string[];
|
|
508
508
|
declare function isTwoWayRefString(value: unknown): value is string;
|
|
509
509
|
/**
|
|
510
|
-
* True when a string contains two-way ref
|
|
511
|
-
*
|
|
510
|
+
* True when a string contains the two-way ref opener `[(` but is not a valid standalone
|
|
511
|
+
* two-way ref (exact form `[(refPath)]`). Mixing two-way with literals or {{ }} is invalid.
|
|
512
|
+
* Plain `)]` substrings (e.g. Tailwind `minmax(0,1fr)]`) are not treated as two-way syntax.
|
|
512
513
|
*/
|
|
513
514
|
declare function isInvalidTwoWayMix(value: unknown): value is string;
|
|
514
515
|
/**
|
|
@@ -660,6 +661,9 @@ interface BlockLoadOptions {
|
|
|
660
661
|
blockDefinitions?: Record<string, BlockDefinitionOrLoader>;
|
|
661
662
|
}
|
|
662
663
|
declare const INTERPOLATE_MAX_PLACEHOLDERS = 200;
|
|
664
|
+
/** Builds a two-way binding when only a read getter exists for the key (used by {@link createInputBindingsWithWarnings}). */
|
|
665
|
+
declare function linkedTwoWayFromInputGetter(resolvedInputs: Record<string, (() => unknown) | undefined>, key: string): WritableSignal<unknown>;
|
|
666
|
+
declare function createInputBindingsWithWarnings(ownerName: string, inputKeys: Set<string>, twoWayKeys: Set<string>, outputKeys: Set<string>, resolvedInputs: Record<string, (() => unknown) | undefined>, resolvedTwoWay: Record<string, unknown>, resolvedOutputs: Record<string, (value: unknown) => void>): _angular_core.Binding[];
|
|
663
667
|
declare class BlockLoaderService {
|
|
664
668
|
private readonly componentRegistry;
|
|
665
669
|
private readonly directiveRegistry;
|
|
@@ -674,17 +678,16 @@ declare class BlockLoaderService {
|
|
|
674
678
|
private getDirectiveTypes;
|
|
675
679
|
/** Resolve model from desc (interpolate ref if string) and set on blockInstance. */
|
|
676
680
|
private resolveContextModel;
|
|
677
|
-
private valueContainsTemplate;
|
|
678
|
-
private resolveNestedModelTemplates;
|
|
679
681
|
private withModelOverrideContext;
|
|
680
682
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BlockLoaderService, never>;
|
|
681
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
683
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
682
684
|
}
|
|
683
685
|
|
|
684
686
|
declare class BlockDirective {
|
|
685
687
|
private readonly viewContainerRef;
|
|
686
688
|
private readonly loader;
|
|
687
689
|
private readonly destroyRef;
|
|
690
|
+
private readonly loadState;
|
|
688
691
|
/** Full description, or { id } / { blockId, blockDefinition? } to reuse/override from blockDefinitions. */
|
|
689
692
|
readonly description: _angular_core.InputSignal<BlockInput | BlockReference | null>;
|
|
690
693
|
/** Registry for block instances by id; pass from root so nested blocks share it. */
|
|
@@ -698,24 +701,37 @@ declare class BlockDirective {
|
|
|
698
701
|
* Useful for "same component, different inputs" scenarios like tabs/switch blocks.
|
|
699
702
|
*/
|
|
700
703
|
readonly reloadKey: _angular_core.InputSignal<unknown>;
|
|
701
|
-
|
|
702
|
-
private lastRegistry;
|
|
703
|
-
private lastId;
|
|
704
|
-
private loadedComponent;
|
|
705
|
-
private loadedServicesKey;
|
|
706
|
-
private loadedReloadKey;
|
|
707
|
-
private loadedDescKey;
|
|
708
|
-
private loadGeneration;
|
|
709
|
-
/** Invalidates in-flight block-reference resolution when the effect re-runs. */
|
|
710
|
-
private effectRunId;
|
|
711
|
-
/** Avoid re-parsing when the same description reference is passed (e.g. stable signal). */
|
|
712
|
-
private lastDescRef;
|
|
713
|
-
private lastParsedData;
|
|
704
|
+
loadBlock(resolved: BlockInput | BlockReference, registry?: BlockRegistry, blockDefinitions?: Record<string, BlockDefinitionOrLoader>): Promise<_angular_core.ComponentRef<unknown>>;
|
|
714
705
|
constructor();
|
|
715
|
-
private clear;
|
|
716
706
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BlockDirective, never>;
|
|
717
707
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BlockDirective, "[block]", never, { "description": { "alias": "description"; "required": false; "isSignal": true; }; "blockRegistry": { "alias": "blockRegistry"; "required": false; "isSignal": true; }; "blockDefinitions": { "alias": "blockDefinitions"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "reloadKey": { "alias": "reloadKey"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
718
708
|
}
|
|
719
709
|
|
|
720
|
-
|
|
721
|
-
|
|
710
|
+
/** JSON-like objects only — skip class instances, Date, Map, etc. */
|
|
711
|
+
declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
712
|
+
/**
|
|
713
|
+
* Child block entry in a parent input tree (`blocks`, `rows`, `columns`, etc.).
|
|
714
|
+
* Template refs inside these objects are resolved when that block is loaded, not on the parent.
|
|
715
|
+
*/
|
|
716
|
+
declare function looksLikeBlockDescriptor(value: unknown): boolean;
|
|
717
|
+
/** Same as {@link looksLikeBlockDescriptor}; use in custom layout blocks if needed. */
|
|
718
|
+
declare const shouldDeferInputTemplateResolution: typeof looksLikeBlockDescriptor;
|
|
719
|
+
/** True when any string leaf in the tree needs input-style resolution (mustache, flow, or `[( )]`). */
|
|
720
|
+
declare function valueNeedsInputResolve(value: unknown, visited?: WeakSet<object>): boolean;
|
|
721
|
+
/** True when any string leaf contains `{{ }}` (block model seeding). */
|
|
722
|
+
declare function valueContainsMustacheInTree(value: unknown, visited?: WeakSet<object>): boolean;
|
|
723
|
+
interface ResolveNestedTemplateOptions {
|
|
724
|
+
/**
|
|
725
|
+
* When true, exact `[(refPath)]` strings resolve to the current ref value (read-only).
|
|
726
|
+
* Does not create Angular two-way bindings on nested keys.
|
|
727
|
+
*/
|
|
728
|
+
resolveTwoWayStringsAsReadonly?: boolean;
|
|
729
|
+
escapeFlowRefs?: boolean;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Deep-resolve template strings in plain objects and arrays (new object graph each call).
|
|
733
|
+
*/
|
|
734
|
+
declare function resolveNestedTemplateValues(value: unknown, ctx: ResolverContext, path?: string, visited?: WeakSet<object>, options?: ResolveNestedTemplateOptions): unknown;
|
|
735
|
+
|
|
736
|
+
export { BlockDefinitionsRegistry, BlockDirective, BlockLoaderService, BlockRegistryImpl, BlockRegistryService, ChainedBlockRegistry, ComponentRegistry, DirectiveRegistry, GuardRegistry, INTERPOLATE_MAX_PLACEHOLDERS, RegistryMetadataStore, RouteLoader, ServiceRegistry, buildComputedForTemplate, classifyTwoWayString, collectRefPaths, createInputBindingsWithWarnings, createOutputHandler, deepMergeBlockDefinition, evaluateExpression, extractReadonlyRefs, getRefPathFromReadonly, getRefSignal, getRefValue, getValueByPath, interpretFlow, isBlockDefinitionLoader, isBlockReference, isInvalidTwoWayMix, isOutputCallObject, isOutputReference, isPlainObject, isTwoWayRefString, linkedTwoWayFromInputGetter, looksLikeBlockDescriptor, looksLikeFlowTemplate, mustacheSegmentToString, normalizeDirectives, normalizeServices, parseFlowTemplate, parseRefPath, parseTwoWayRef, refPathResolvesToSignal, resolveBlockReference, resolveMustacheInterpolatedString, resolveNestedTemplateValues, resolveRefOrModel, resolveRefPath, resolveReferenceValue, resolveTemplateString, safeParseBlockDescription, setRefValue, shouldDeferInputTemplateResolution, splitCallableRef, valueContainsMustacheInTree, valueNeedsInputResolve };
|
|
737
|
+
export type { AllRegistryMetadata, BlockDefinitionLoader, BlockDefinitionOrLoader, BlockDescription, BlockInput, BlockInstanceHandle, BlockLoadOptions, BlockOutputValue, BlockReference, BlockRegistry, CurrentInstance, FlowNode, FlowScope, GuardLoader, GuardOrLoader, GuardOrType, InterpretFlowOptions, OutputCallObject, OutputOnError, OutputReference, ParsedRefPath, RegistryEntryType, RegistryMetadataRecord, ResolveNestedTemplateOptions, ResolveTemplateStringOptions, ResolverContext, RouteConfig, RouteConfigs, SafeParseBlockDescriptionResult, ScopedRegistryNode, ServiceEntry, ThenChainStep };
|