Skip to content

Commit

Permalink
fix safari map iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
neSpecc committed Oct 30, 2024
1 parent 75cde4f commit b1fabcd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default class NestedList {

/**
* On paste sanitzation config. Allow only tags that are allowed in the Tool.
*
* @returns - paste config object used in editor
*/
public static get pasteConfig(): PasteConfig {
Expand All @@ -89,18 +90,20 @@ export default class NestedList {
public static get conversionConfig(): {
/**
* Method that is responsible for conversion from data to string
*
* @param data - current list data
* @returns - contents string formed from list data
*/
export: (data: ListData) => string;

/**
* Method that is responsible for conversion from string to data
*
* @param content - contents string
* @returns - list data formed from contents string
*/
import: (content: string, config: ToolConfig<NestedListConfig>) => ListData;
} {
} {
return {
export: (data) => {
return NestedList.joinRecursive(data);
Expand Down Expand Up @@ -129,6 +132,7 @@ export default class NestedList {

/**
* Set list style
*
* @param style - new style to set
*/
private set listStyle(style: ListDataStyle) {
Expand Down Expand Up @@ -188,6 +192,7 @@ export default class NestedList {

/**
* Render plugin`s main Element and fill it with saved data
*
* @param params - tool constructor options
* @param params.data - previously saved data
* @param params.config - user config for Tool
Expand Down Expand Up @@ -224,6 +229,7 @@ export default class NestedList {

/**
* Convert from list to text for conversionConfig
*
* @param data - current data of the list
* @returns - string of the recursively merged contents of the items of the list
*/
Expand All @@ -235,6 +241,7 @@ export default class NestedList {

/**
* Function that is responsible for content rendering
*
* @returns rendered list wrapper with all contents
*/
public render(): HTMLElement {
Expand All @@ -245,6 +252,7 @@ export default class NestedList {

/**
* Function that is responsible for content saving
*
* @returns formatted content used in editor
*/
public save(): ListData {
Expand All @@ -255,6 +263,7 @@ export default class NestedList {

/**
* Function that is responsible for mergind two lists into one
*
* @param data - data of the next standing list, that should be merged with current
*/
public merge(data: ListData): void {
Expand All @@ -263,6 +272,7 @@ export default class NestedList {

/**
* Creates Block Tune allowing to change the list style
*
* @returns array of tune configs
*/
public renderSettings(): MenuConfigItem[] {
Expand Down Expand Up @@ -334,7 +344,8 @@ export default class NestedList {
* For each counter type in OlCounterType create toolbox item
*/
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
OlCounterTypesMap.keys().forEach((counterType: string) => {

OlCounterTypesMap.forEach((_, counterType: string) => {
orderedListCountersTunes.children.items!.push({
title: this.api.i18n.t(counterType),
isActive: this.data.counterType === OlCounterTypesMap.get(counterType),
Expand All @@ -353,6 +364,7 @@ export default class NestedList {

/**
* Changes ordered list counterType property value
*
* @param counterType - new value of the counterType value
*/
private changeCounters(counterType: OlCounterType): void {
Expand All @@ -363,6 +375,7 @@ export default class NestedList {

/**
* Changes ordered list start property value
*
* @param index - new value of the start property
*/
private changeStartWith(index: number): void {
Expand Down

0 comments on commit b1fabcd

Please sign in to comment.