Skip to content

Commit

Permalink
Bump Version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Humphreys committed Feb 21, 2020
1 parent 53f2577 commit 8948638
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 60 deletions.
25 changes: 5 additions & 20 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
{
"name": "tribute",
"description": "Native ES6 @mentions",
"version": "4.1.1",
"main": [
"dist/tribute.js",
"dist/tribute.css"
],
"authors": [
"Jordan Humphreys <jordan@zurb.com>"
],
"version": "4.1.2",
"main": ["dist/tribute.js", "dist/tribute.css"],
"authors": ["Jordan Humphreys <jordan@zurb.com>"],
"license": "MIT",
"keywords": [
"mentions",
"autocomplete",
"fuzzy",
"search"
],
"keywords": ["mentions", "autocomplete", "fuzzy", "search"],
"homepage": "https://github.com/zurb/tribute",
"moduleType": [],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test"
]
"ignore": ["**/.*", "node_modules", "bower_components", "test"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tributejs",
"version": "4.1.1",
"version": "4.1.2",
"description": "Native ES6 @mentions",
"main": "dist/tribute.js",
"types": "tributejs.d.ts",
Expand Down
80 changes: 41 additions & 39 deletions tributejs.d.ts
Original file line number Diff line number Diff line change
@@ -1,92 +1,94 @@
// Type definitions for TributeJS v4.1.1
// Type definitions for TributeJS v4.1.2
// Project: https://github.com/zurb/tribute
// Definitions by: Jordan Humphreys <https://github.com/mrsweaters/>

export type TributeItem<T extends {}> = {
index: number
original: T
score: number
string: string
}
index: number;
original: T;
score: number;
string: string;
};

export type TributeSearchOpts = {
pre: string
post: string
skip: boolean
}
pre: string;
post: string;
skip: boolean;
};

export type TributeCollection<T extends {}> = {
// symbol that starts the lookup
trigger?: string
trigger?: string;

// element to target for @mentions
iframe?: any
iframe?: any;

// class added in the flyout menu for active item
selectClass?: string
selectClass?: string;

// class added in the flyout menu for active item
containerClass?: string
containerClass?: string;

itemClass?: string
itemClass?: string;

// function called on select that returns the content to insert
selectTemplate?: (item: TributeItem<T>) => string
selectTemplate?: (item: TributeItem<T>) => string;

// template for displaying item in menu
menuItemTemplate?: (item: TributeItem<T>) => string
menuItemTemplate?: (item: TributeItem<T>) => string;

// template for when no match is found (optional),
// If no template is provided, menu is hidden.
noMatchTemplate?: () => string
noMatchTemplate?: () => string;

// specify an alternative parent container for the menu
menuContainer?: Element
menuContainer?: Element;

// column to search against in the object (accepts function or string)
lookup?: string | ((item: T, mentionText: string) => string)
lookup?: string | ((item: T, mentionText: string) => string);

// column that contains the content to insert by default
fillAttr?: string
fillAttr?: string;

// array of objects to match
values?: Array<T> | ((text: string, cb: (result: Array<T>) => void) => void)
values?: Array<T> | ((text: string, cb: (result: Array<T>) => void) => void);

// specify whether a space is required before the trigger character
requireLeadingSpace?: boolean
requireLeadingSpace?: boolean;

// specify whether a space is allowed in the middle of mentions
allowSpaces?: boolean
allowSpaces?: boolean;

// optionally specify a custom suffix for the replace text
// (defaults to empty space if undefined)
replaceTextSuffix?: string
replaceTextSuffix?: string;

//specify whether the menu should be positioned
positionMenu?: boolean
positionMenu?: boolean;

//specify whether to put Tribute in autocomplete mode
autocompleteMode?: boolean
autocompleteMode?: boolean;

// Customize the elements used to wrap matched strings within the results list
searchOpts?: TributeSearchOpts
}
searchOpts?: TributeSearchOpts;
};

export type TributeOptions<T> = TributeCollection<T> | {
// pass an array of config objects
collection: Array<TributeCollection<{ [key: string]: any }>>
}
export type TributeOptions<T> =
| TributeCollection<T>
| {
// pass an array of config objects
collection: Array<TributeCollection<{ [key: string]: any }>>;
};

export default class Tribute<T extends {}> {
constructor(options: TributeOptions<T>)
constructor(options: TributeOptions<T>);

isActive: boolean
isActive: boolean;

append(index: number, values: Array<T>, replace?: boolean): void
append(index: number, values: Array<T>, replace?: boolean): void;

appendCurrent(values: Array<T>, replace?: boolean): void
appendCurrent(values: Array<T>, replace?: boolean): void;

attach(to: Element): void
attach(to: Element): void;

detach(to: Element): void
detach(to: Element): void;
}

0 comments on commit 8948638

Please sign in to comment.