@ucme-ui/angular 0.3.0 → 0.4.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucme-ui/angular",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Angular 20–22 UI component kütüphanesi ve admin layout — signals, standalone, bağımlılıksız SCSS token'ları, açık/koyu tema.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -737,6 +737,263 @@ export declare class HuDatePicker implements ControlValueAccessor, Validator, Hu
737
737
  "value": "valueChange";
738
738
  }, never, never, true, never>;
739
739
  }
740
+ /** Link adresi güvenli mi? (`javascript:`, `data:` vb. reddedilir) */
741
+ export declare function huIsSafeUrl(url: string): boolean;
742
+ /** Görsel adresi güvenli mi? */
743
+ export declare function huIsSafeImageSrc(src: string): boolean;
744
+ /**
745
+ * HTML'i editörün izin verdiği alt kümeye indirger.
746
+ * Sunucudan gelen veya kullanıcıların girdiği HTML'i göstermeden önce de kullanabilirsiniz.
747
+ */
748
+ export declare function huSanitizeHtml(html: string, doc?: Document): string;
749
+ /** Araç çubuğundaki öğeler. `'|'` bir ayraçtır. */
750
+ export type HuEditorTool = 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'textColor' | 'highlight' | 'bulletList' | 'orderedList' | 'blockquote' | 'codeBlock' | 'link' | 'image' | 'clear' | 'undo' | 'redo' | '|';
751
+ export declare const HU_EDITOR_DEFAULT_TOOLBAR: readonly HuEditorTool[];
752
+ /** Sade araç çubuğu: yorum, not gibi kısa metinler için. */
753
+ export declare const HU_EDITOR_MINIMAL_TOOLBAR: readonly HuEditorTool[];
754
+ export interface HuEditorButton {
755
+ tool: Exclude<HuEditorTool, 'heading' | '|'>;
756
+ icon: string;
757
+ label: string;
758
+ /** Ekranda gösterilen kısayol (ipucu metninde). */
759
+ shortcut?: string;
760
+ }
761
+ export declare const HU_EDITOR_BUTTONS: Record<HuEditorButton['tool'], HuEditorButton>;
762
+ export type HuEditorBlock = 'p' | 'h1' | 'h2' | 'h3';
763
+ export declare const HU_EDITOR_BLOCKS: {
764
+ value: HuEditorBlock;
765
+ label: string;
766
+ }[];
767
+ export interface HuEditorColor {
768
+ label: string;
769
+ /** CSS renk değeri (hex veya rgb/rgba). */
770
+ value: string;
771
+ }
772
+ /**
773
+ * Yazı renkleri. Açık ve koyu temada okunabilen orta tonlar seçildi.
774
+ * Yalnızca paletteki renkler kalıcıdır: tarayıcının kendiliğinden eklediği
775
+ * (koyu temada okunmaz hale gelen) metin renkleri temizlenir.
776
+ */
777
+ export declare const HU_EDITOR_TEXT_COLORS: readonly HuEditorColor[];
778
+ /** Vurgu (arka plan) renkleri: yarı saydam, böylece koyu temada da metin okunur. */
779
+ export declare const HU_EDITOR_HIGHLIGHT_COLORS: readonly HuEditorColor[];
780
+ /**
781
+ * Görsel yükleme işleyicisi: dosyayı sunucuya yükleyip görselin adresini döndürür.
782
+ * Verilmezse görsel data URL olarak HTML'e gömülür.
783
+ */
784
+ export type HuEditorImageUpload = (file: File) => Promise<string>;
785
+ type ToggleTool = HuEditorButton['tool'];
786
+ type Panel = 'link' | 'image' | 'textColor' | 'highlight';
787
+ /**
788
+ * Zengin metin editörü. Değer HTML metnidir; formlarla (`formControlName`) veya
789
+ * `[(value)]` ile çalışır. Yapıştırılan ve dışarıdan verilen HTML izin listesiyle
790
+ * temizlenir (script, stil, `javascript:` linkleri atılır).
791
+ *
792
+ * Bağımlılık yoktur: tarayıcının `contenteditable` alanı üzerine kuruludur.
793
+ *
794
+ * @example
795
+ * <hu-form-field label="Açıklama" required>
796
+ * <hu-editor formControlName="description" placeholder="Duyuru metnini yazın…" />
797
+ * </hu-form-field>
798
+ *
799
+ * <hu-editor [(value)]="html" [imageUpload]="uploadToServer" />
800
+ */
801
+ export declare class HuEditor implements ControlValueAccessor, HuFormFieldControl, DoCheck {
802
+ private readonly doc;
803
+ private readonly injector;
804
+ private readonly host;
805
+ protected readonly field: import("@ucme-ui/angular").HuFormFieldParent | null;
806
+ /** HTML değer. Boş içerik `''` olarak döner (Validators.required ile uyumlu). */
807
+ readonly value: import("@angular/core").ModelSignal<string>;
808
+ readonly placeholder: import("@angular/core").InputSignal<string>;
809
+ readonly toolbar: import("@angular/core").InputSignal<readonly HuEditorTool[]>;
810
+ readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
811
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
812
+ /** Altta kelime ve karakter sayısı. */
813
+ readonly showCount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
814
+ readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
815
+ readonly id: import("@angular/core").InputSignal<string>;
816
+ /** Yazı rengi paleti. Yalnızca bu renkler kalıcıdır. */
817
+ readonly textColors: import("@angular/core").InputSignal<readonly HuEditorColor[]>;
818
+ /** Vurgu (arka plan) paleti. */
819
+ readonly highlightColors: import("@angular/core").InputSignal<readonly HuEditorColor[]>;
820
+ /**
821
+ * Görseli sunucuya yükleyip adresini döndüren fonksiyon. Verilmezse görsel
822
+ * data URL olarak HTML'e gömülür (küçük görseller için uygundur).
823
+ */
824
+ readonly imageUpload: import("@angular/core").InputSignal<HuEditorImageUpload | null>;
825
+ /** Kabul edilen en büyük görsel dosyası (bayt). Varsayılan 2 MB. */
826
+ readonly maxImageSize: import("@angular/core").InputSignal<number>;
827
+ protected readonly buttons: Record<"bold" | "italic" | "underline" | "link" | "undo" | "redo" | "image" | "blockquote" | "strike" | "textColor" | "highlight" | "bulletList" | "orderedList" | "codeBlock" | "clear", HuEditorButton>;
828
+ protected readonly blocks: {
829
+ value: HuEditorBlock;
830
+ label: string;
831
+ }[];
832
+ protected readonly focused: import("@angular/core").WritableSignal<boolean>;
833
+ protected readonly active: import("@angular/core").WritableSignal<ReadonlySet<"bold" | "italic" | "underline" | "link" | "undo" | "redo" | "image" | "blockquote" | "strike" | "textColor" | "highlight" | "bulletList" | "orderedList" | "codeBlock" | "clear">>;
834
+ protected readonly block: import("@angular/core").WritableSignal<HuEditorBlock>;
835
+ protected readonly isEmpty: import("@angular/core").WritableSignal<boolean>;
836
+ protected readonly counts: import("@angular/core").WritableSignal<{
837
+ words: number;
838
+ chars: number;
839
+ }>;
840
+ /** Araç çubuğunun altında açık olan panel (link, görsel, renk). */
841
+ protected readonly panel: import("@angular/core").WritableSignal<Panel | null>;
842
+ protected readonly linkUrl: import("@angular/core").WritableSignal<string>;
843
+ protected readonly hasLink: import("@angular/core").WritableSignal<boolean>;
844
+ protected readonly imageUrl: import("@angular/core").WritableSignal<string>;
845
+ protected readonly imageAlt: import("@angular/core").WritableSignal<string>;
846
+ protected readonly uploading: import("@angular/core").WritableSignal<boolean>;
847
+ protected readonly panelError: import("@angular/core").WritableSignal<string>;
848
+ /** Son kullanılan renkler: butonun altındaki renk şeridi. */
849
+ protected readonly lastTextColor: import("@angular/core").WritableSignal<string | null>;
850
+ protected readonly lastHighlight: import("@angular/core").WritableSignal<string | null>;
851
+ private readonly formDisabled;
852
+ protected readonly isDisabled: import("@angular/core").Signal<boolean>;
853
+ protected readonly editable: import("@angular/core").Signal<boolean>;
854
+ private readonly content;
855
+ private readonly panelInput;
856
+ private readonly fileInput;
857
+ private ready;
858
+ /** Son yayınlanan değer: dışarıdan gelen yankıyı içeriğe tekrar yazmamak için. */
859
+ private lastEmitted;
860
+ private savedRange;
861
+ /** Palet renklerinin tarayıcının yazdığı biçimdeki (rgb/rgba) karşılıkları. */
862
+ private readonly allowedText;
863
+ private readonly allowedHighlight;
864
+ private onChange;
865
+ private onTouched;
866
+ private ngControl;
867
+ get hasControl(): boolean;
868
+ readonly controlErrorVisible: import("@angular/core").WritableSignal<boolean>;
869
+ readonly errors: import("@angular/core").WritableSignal<ValidationErrors | null>;
870
+ protected readonly isInvalid: import("@angular/core").Signal<boolean>;
871
+ constructor();
872
+ ngDoCheck(): void;
873
+ protected run(tool: ToggleTool): void;
874
+ protected setBlock(tag: string): void;
875
+ protected isToggle(tool: ToggleTool): boolean;
876
+ /** Panel açan butonlar: panel açıkken basılı görünür. */
877
+ protected isPanelTool(tool: ToggleTool): boolean;
878
+ private togglePanel;
879
+ protected closePanel(): void;
880
+ private focusPanelInput;
881
+ /** Renk uygula; `null` rengi kaldırır. */
882
+ protected applyColor(kind: 'textColor' | 'highlight', color: string | null): void;
883
+ protected openLink(): void;
884
+ protected applyLink(): void;
885
+ protected removeLink(): void;
886
+ protected insertImageFromUrl(): void;
887
+ protected chooseFile(): void;
888
+ protected onFileChosen(event: Event): Promise<void>;
889
+ private uploadImage;
890
+ private insertImage;
891
+ private showPanelError;
892
+ protected onInput(): void;
893
+ protected onFocus(): void;
894
+ protected onKeydown(event: KeyboardEvent): void;
895
+ protected onContentClick(event: MouseEvent): void;
896
+ protected onPaste(event: ClipboardEvent): void;
897
+ protected onDrop(event: DragEvent): void;
898
+ protected onSelectionChange(): void;
899
+ protected onFocusOut(event: FocusEvent): void;
900
+ writeValue(value: unknown): void;
901
+ registerOnChange(fn: (value: string) => void): void;
902
+ registerOnTouched(fn: () => void): void;
903
+ setDisabledState(disabled: boolean): void;
904
+ /** Seçimi geri yükle, komutu uygula, değeri yayınla. */
905
+ private exec;
906
+ private command;
907
+ /**
908
+ * Seçim hâlâ editörün içindeyse onu kaydet. `selectionchange` gecikmeli geldiği
909
+ * için hızlı klavye kullanımında (Shift+ok, hemen Ctrl+K) kayıtlı seçim eski kalabilir.
910
+ */
911
+ private captureSelection;
912
+ private restoreSelection;
913
+ /**
914
+ * Tarayıcılar komutlarda (yapıştırma, satır birleştirme) çevredeki stili satır içi
915
+ * `style` olarak ekler. Yalnızca paletteki renkleri koru, gerisini sil; böylece
916
+ * örneğin tarayıcının eklediği koyu metin rengi koyu temada okunmaz hale gelmez.
917
+ * Öznitelik değiştirmek düğümleri taşımadığı için imleç yerinde kalır.
918
+ */
919
+ private cleanInlineStyles;
920
+ /** Renk değerini tarayıcının kullandığı tek biçime çevirir (karşılaştırma için). */
921
+ private normalizeColor;
922
+ private insertTransfer;
923
+ private emit;
924
+ private applyExternal;
925
+ /** İçeriği temiz HTML'e çevirir; görünür içerik yoksa `''`. */
926
+ private serialize;
927
+ private updateDerived;
928
+ private updateState;
929
+ private selectionAnchor;
930
+ private resolveControl;
931
+ static ɵfac: i0.ɵɵFactoryDeclaration<HuEditor, never>;
932
+ static ɵcmp: i0.ɵɵComponentDeclaration<HuEditor, "hu-editor", never, {
933
+ "value": {
934
+ "alias": "value";
935
+ "required": false;
936
+ "isSignal": true;
937
+ };
938
+ "placeholder": {
939
+ "alias": "placeholder";
940
+ "required": false;
941
+ "isSignal": true;
942
+ };
943
+ "toolbar": {
944
+ "alias": "toolbar";
945
+ "required": false;
946
+ "isSignal": true;
947
+ };
948
+ "readonly": {
949
+ "alias": "readonly";
950
+ "required": false;
951
+ "isSignal": true;
952
+ };
953
+ "disabled": {
954
+ "alias": "disabled";
955
+ "required": false;
956
+ "isSignal": true;
957
+ };
958
+ "showCount": {
959
+ "alias": "showCount";
960
+ "required": false;
961
+ "isSignal": true;
962
+ };
963
+ "ariaLabel": {
964
+ "alias": "ariaLabel";
965
+ "required": false;
966
+ "isSignal": true;
967
+ };
968
+ "id": {
969
+ "alias": "id";
970
+ "required": false;
971
+ "isSignal": true;
972
+ };
973
+ "textColors": {
974
+ "alias": "textColors";
975
+ "required": false;
976
+ "isSignal": true;
977
+ };
978
+ "highlightColors": {
979
+ "alias": "highlightColors";
980
+ "required": false;
981
+ "isSignal": true;
982
+ };
983
+ "imageUpload": {
984
+ "alias": "imageUpload";
985
+ "required": false;
986
+ "isSignal": true;
987
+ };
988
+ "maxImageSize": {
989
+ "alias": "maxImageSize";
990
+ "required": false;
991
+ "isSignal": true;
992
+ };
993
+ }, {
994
+ "value": "valueChange";
995
+ }, never, never, true, never>;
996
+ }
740
997
  export type HuSpinnerSize = 'sm' | 'md' | 'lg';
741
998
  /** @example <hu-spinner /> <hu-spinner size="lg" label="Veriler yükleniyor" /> */
742
999
  export declare class HuSpinner {
@@ -1348,8 +1605,17 @@ export declare class HuDropdown<T = string> {
1348
1605
  protected readonly customTrigger: import("@angular/core").Signal<HuDropdownTrigger | undefined>;
1349
1606
  protected readonly isDivider: typeof isDropdownDivider;
1350
1607
  protected readonly isHeader: typeof isDropdownHeader;
1608
+ /**
1609
+ * Panel Popover API ile sayfanın üst katmanında (top layer) açılır: "appendTo body"
1610
+ * gibi davranır, kart/tablo/dialog'un overflow'u tarafından kesilmez. DOM'da yerinde
1611
+ * kaldığı için odak ve dışarı tıklama mantığı aynen çalışır.
1612
+ */
1613
+ protected readonly supportsPopover: boolean;
1614
+ private readonly panel;
1615
+ private focusOnOpen;
1351
1616
  private typeahead;
1352
1617
  private typeaheadTimer?;
1618
+ constructor();
1353
1619
  toggle(): void;
1354
1620
  show(): void;
1355
1621
  close(restoreFocus?: boolean): void;
@@ -1359,6 +1625,9 @@ export declare class HuDropdown<T = string> {
1359
1625
  protected onPanelKeydown(event: KeyboardEvent): void;
1360
1626
  /** Harfe basınca o harfle başlayan öğeye git (ör. "S" → "Sil"). */
1361
1627
  private findByTypeahead;
1628
+ private syncPanel;
1629
+ /** Tetikleyicinin altına (yer yoksa üstüne) yerleştirir; ekran kenarından taşırmaz. */
1630
+ private positionPanel;
1362
1631
  private items;
1363
1632
  private triggerElement;
1364
1633
  static ɵfac: i0.ɵɵFactoryDeclaration<HuDropdown<any>, never>;
@@ -1430,8 +1699,17 @@ export interface HuNavItem {
1430
1699
  link?: string;
1431
1700
  /** Link yalnızca birebir eşleştiğinde aktif sayılsın. */
1432
1701
  exact?: boolean;
1702
+ /** Sayı (`12`) dolu rozet olarak, metin (`'Yeni'`) açık renkli etiket olarak gösterilir. */
1433
1703
  badge?: string | number;
1704
+ /**
1705
+ * Alt menü. Alt öğelerin kendi `children`'ı varsa o öğe tıklanamaz bir
1706
+ * kategori başlığı olur ve altındaki linkler onun altında listelenir:
1707
+ *
1708
+ * `{ label: 'Componentler', children: [{ label: 'Form', children: [{ label: 'Button', link: '…' }] }] }`
1709
+ */
1434
1710
  children?: HuNavItem[];
1711
+ /** Alt menü başlangıçta açık gelsin (kullanıcı sonra kapatabilir). */
1712
+ expanded?: boolean;
1435
1713
  }
1436
1714
  export interface HuNavGroup {
1437
1715
  /** Grup başlığı (örn. "Yönetim"). */
@@ -1441,6 +1719,8 @@ export interface HuNavGroup {
1441
1719
  /** Yan menü navigasyonu. Genellikle `hu-shell` içinde otomatik kullanılır. */
1442
1720
  export declare class HuSidebarNav {
1443
1721
  private readonly router;
1722
+ private readonly host;
1723
+ private readonly injector;
1444
1724
  readonly groups: import("@angular/core").InputSignal<HuNavGroup[]>;
1445
1725
  readonly collapsed: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1446
1726
  /** Bir linke tıklandı (mobilde menüyü kapatmak için). */
@@ -1450,7 +1730,10 @@ export declare class HuSidebarNav {
1450
1730
  private readonly url;
1451
1731
  protected readonly openItems: import("@angular/core").WritableSignal<ReadonlySet<HuNavItem>>;
1452
1732
  constructor();
1733
+ /** Öğenin herhangi bir alt (veya kategori altı) linki aktif mi? */
1453
1734
  protected isParentActive(item: HuNavItem, url?: string): boolean;
1735
+ /** `'Yeni'` gibi metin rozetleri sayılardan farklı görünür. */
1736
+ protected isTextBadge(badge: string | number): boolean;
1454
1737
  protected toggle(item: HuNavItem): void;
1455
1738
  static ɵfac: i0.ɵɵFactoryDeclaration<HuSidebarNav, never>;
1456
1739
  static ɵcmp: i0.ɵɵComponentDeclaration<HuSidebarNav, "hu-sidebar-nav", never, {