Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(elements|ino-markdown-editor): edit links after inserting them #1024

Merged
merged 24 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a33aa37
Implemented simple JS dialog behaviour; WIP
BingeCode Jun 29, 2023
9185f6d
WIP
BingeCode Jun 30, 2023
5e2c203
MVP; Minor improvements needed
BingeCode Jun 30, 2023
d53fab4
WIP; Finish extracting component; red colors; lint
BingeCode Jul 19, 2023
218668a
Merge branch 'master' into elements-ino-markdown-editor-link-fix
BingeCode Aug 30, 2023
c0a1f6f
Merge branch 'master' into elements-ino-markdown-editor-link-fix
BingeCode Sep 4, 2023
cf07206
Merge branch 'master' into elements-ino-markdown-editor-link-fix
BingeCode Sep 4, 2023
f428f8f
Minor tweaks
BingeCode Sep 4, 2023
e4428cd
quick fix
BingeCode Sep 4, 2023
d3ee640
fix link propagation
BingeCode Sep 13, 2023
3b16aaf
refactor: restore markdown docs
janivo Sep 28, 2023
8ba34a4
Merge branch 'master' into elements-ino-markdown-editor-link-fix
janivo Sep 28, 2023
ec4d076
refactor: restore markdown docs
janivo Sep 28, 2023
c393e10
chore: update caniuse
janivo Sep 28, 2023
bb5cdad
Removed styles
BingeCode Oct 2, 2023
57bf8c6
ordered according to enum
BingeCode Oct 2, 2023
a5d9172
replaced ino-button w/ ino-icon-button; fixed case missing bug;
BingeCode Oct 4, 2023
5416a25
added comment
BingeCode Oct 6, 2023
79cfbb5
Merge branch 'master' into elements-ino-markdown-editor-link-fix
BingeCode Oct 6, 2023
08867ec
Fixed ino-icon-button disabled bug
BingeCode Oct 6, 2023
2a6a642
Fixed click event propagation; Added enter shortcut;
BingeCode Oct 6, 2023
f3964c0
Ran yarn build;
BingeCode Oct 12, 2023
ef82882
refactor: adjust icon
janivo Oct 13, 2023
fdaf534
refactor: remove leftover files from angular changes
janivo Oct 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
janivo marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* eslint-disable */
/* tslint:disable */
import { fromEvent } from 'rxjs';

export const proxyInputs = (Cmp: any, inputs: string[]) => {
const Prototype = Cmp.prototype;
inputs.forEach(item => {
Object.defineProperty(Prototype, item, {
get() {
return this.el[item];
},
set(val: any) {
this.z.runOutsideAngular(() => (this.el[item] = val));
}
});
});
};

export const proxyMethods = (Cmp: any, methods: string[]) => {
const Prototype = Cmp.prototype;
methods.forEach(methodName => {
Prototype[methodName] = function () {
const args = arguments;
return this.z.runOutsideAngular(() =>
this.el[methodName].apply(this.el, args)
);
};
});
};

export const proxyOutputs = (instance: any, el: any, events: string[]) => {
events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
}

export const defineCustomElement = (tagName: string, customElement: any) => {
if (
customElement !== undefined &&
typeof customElements !== 'undefined' &&
!customElements.get(tagName)
) {
customElements.define(tagName, customElement);
}
}

// tslint:disable-next-line: only-arrow-functions
export function ProxyCmp(opts: { defineCustomElementFn?: () => void, inputs?: any; methods?: any }) {
const decorator = function (cls: any) {
const { defineCustomElementFn, inputs, methods } = opts;

if (defineCustomElementFn !== undefined) {
defineCustomElementFn();
}

if (inputs) {
proxyInputs(cls, inputs);
}
if (methods) {
proxyMethods(cls, methods);
}
return cls;
};
return decorator;
}
52 changes: 52 additions & 0 deletions packages/elements-angular/elements/src/directives/proxies-list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

import * as d from './proxies';

export const DIRECTIVES = [
d.InoAccordion,
d.InoAutocomplete,
d.InoButton,
d.InoCard,
d.InoCarousel,
d.InoCarouselSlide,
d.InoCheckbox,
d.InoChip,
d.InoControlItem,
d.InoCurrencyInput,
d.InoDatepicker,
d.InoDialog,
d.InoFab,
d.InoFabSet,
d.InoIcon,
d.InoIconButton,
d.InoImg,
d.InoImgList,
d.InoInput,
d.InoInputFile,
d.InoLabel,
d.InoList,
d.InoListDivider,
d.InoListItem,
d.InoMarkdownEditor,
d.InoMenu,
d.InoNavDrawer,
d.InoNavItem,
d.InoOption,
d.InoOptionGroup,
d.InoPopover,
d.InoProgressBar,
d.InoRadio,
d.InoRadioGroup,
d.InoRange,
d.InoSegmentButton,
d.InoSegmentGroup,
d.InoSelect,
d.InoSnackbar,
d.InoSpinner,
d.InoSwitch,
d.InoTab,
d.InoTabBar,
d.InoTable,
d.InoTableHeaderCell,
d.InoTextarea,
d.InoTooltip
];
Loading
Loading