DEV: Convert truth-helpers to a v2 addon and simplify imports (#26029)

No need for a build step here, since the helpers are all simple js.
This commit is contained in:
David Taylor 2024-03-05 15:24:47 +00:00 committed by GitHub
parent 180e6c6188
commit ccf0b61fe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
79 changed files with 135 additions and 134 deletions

View File

@ -1,7 +1,6 @@
import { and, not } from "truth-helpers";
import CookText from "discourse/components/cook-text";
import i18n from "discourse-common/helpers/i18n";
import and from "truth-helpers/helpers/and";
import not from "truth-helpers/helpers/not";
const DashboardNewFeatureItem = <template>
<div class="admin-new-feature-item">

View File

@ -135,7 +135,6 @@ function lookupModuleBySuffix(suffix) {
"discourse-common/",
"select-kit/",
"admin/",
"truth-helpers/",
];
Object.keys(requirejs.entries).forEach((name) => {
if (

View File

@ -2,11 +2,9 @@ import Component from "@glimmer/component";
import { fn } from "@ember/helper";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { and, not, or } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import and from "truth-helpers/helpers/and";
import not from "truth-helpers/helpers/not";
import or from "truth-helpers/helpers/or";
export default class AdminPostMenu extends Component {
@service currentUser;

View File

@ -1,6 +1,6 @@
import { hash } from "@ember/helper";
import { eq } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import eq from "truth-helpers/helpers/eq";
import PluginOutlet from "./plugin-outlet";
const ConditionalLoadingSpinner = <template>

View File

@ -3,13 +3,13 @@ import { action } from "@ember/object";
import { empty, equal, notEmpty } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { or } from "truth-helpers";
import GlimmerComponentWithDeprecatedParentView from "discourse/components/glimmer-component-with-deprecated-parent-view";
import concatClass from "discourse/helpers/concat-class";
import DiscourseURL from "discourse/lib/url";
import icon from "discourse-common/helpers/d-icon";
import deprecated from "discourse-common/lib/deprecated";
import I18n from "discourse-i18n";
import or from "truth-helpers/helpers/or";
const ACTION_AS_STRING_DEPRECATION_ARGS = [
"DButton no longer supports @action as a string. Please refactor to use an closure action instead.",

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component";
import { concat } from "@ember/helper";
import { notEq } from "truth-helpers";
import bodyClass from "discourse/helpers/body-class";
import deprecated from "discourse-common/lib/deprecated";
import notEq from "truth-helpers/helpers/not-eq";
// Can add a body class from within a component
export default class DSection extends Component {

View File

@ -4,12 +4,10 @@ import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { inject as service } from "@ember/service";
import { modifier } from "ember-modifier";
import { and, not, or } from "truth-helpers";
import scrollLock from "discourse/lib/scroll-lock";
import DiscourseURL from "discourse/lib/url";
import { scrollTop } from "discourse/mixins/scroll-top";
import and from "truth-helpers/helpers/and";
import not from "truth-helpers/helpers/not";
import or from "truth-helpers/helpers/or";
import AuthButtons from "./glimmer-header/auth-buttons";
import Contents from "./glimmer-header/contents";
import HamburgerDropdownWrapper from "./glimmer-header/hamburger-dropdown-wrapper";

View File

@ -1,8 +1,7 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { and, not } from "truth-helpers";
import DButton from "discourse/components/d-button";
import and from "truth-helpers/helpers/and";
import not from "truth-helpers/helpers/not";
export default class AuthButtons extends Component {
@service header;

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { hash } from "@ember/helper";
import { inject as service } from "@ember/service";
import and from "truth-helpers/helpers/and";
import { and } from "truth-helpers";
import BootstrapModeNotice from "../bootstrap-mode-notice";
import PluginOutlet from "../plugin-outlet";
import HomeLogo from "./home-logo";

View File

@ -2,11 +2,11 @@ import Component from "@glimmer/component";
import { hash } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { and } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import { wantsNewWindow } from "discourse/lib/intercept-click";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import and from "truth-helpers/helpers/and";
import closeOnClickOutside from "../../modifiers/close-on-click-outside";
export default class Dropdown extends Component {

View File

@ -1,10 +1,8 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { eq, not, or } from "truth-helpers";
import DAG from "discourse/lib/dag";
import getURL from "discourse-common/lib/get-url";
import eq from "truth-helpers/helpers/eq";
import not from "truth-helpers/helpers/not";
import or from "truth-helpers/helpers/or";
import Dropdown from "./dropdown";
import PanelPortal from "./panel-portal";
import UserDropdown from "./user-dropdown";

View File

@ -1,7 +1,5 @@
import { and, eq, notEq } from "truth-helpers";
import getURL from "discourse-common/lib/get-url";
import and from "truth-helpers/helpers/and";
import eq from "truth-helpers/helpers/eq";
import notEq from "truth-helpers/helpers/not-eq";
const Logo = <template>
{{#if (and @darkUrl (notEq @url @darkUrl))}}

View File

@ -4,16 +4,13 @@ import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { and, gt, not, or } from "truth-helpers";
import categoryLink from "discourse/helpers/category-link";
import concatClass from "discourse/helpers/concat-class";
import renderTags from "discourse/lib/render-tags";
import DiscourseURL from "discourse/lib/url";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import and from "truth-helpers/helpers/and";
import gt from "truth-helpers/helpers/gt";
import not from "truth-helpers/helpers/not";
import or from "truth-helpers/helpers/or";
import PluginOutlet from "../../plugin-outlet";
import FeaturedLink from "./featured-link";
import Participant from "./participant";

View File

@ -3,10 +3,10 @@ import { concat, hash } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { eq } from "truth-helpers";
import avatar from "discourse/helpers/bound-avatar-template";
import icon from "discourse-common/helpers/d-icon";
import getURL from "discourse-common/lib/get-url";
import eq from "truth-helpers/helpers/eq";
export default class Participant extends Component {
@service appEvents;

View File

@ -2,10 +2,10 @@ import Component from "@glimmer/component";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { or } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import { wantsNewWindow } from "discourse/lib/intercept-click";
import i18n from "discourse-common/helpers/i18n";
import or from "truth-helpers/helpers/or";
import Notifications from "./user-dropdown/notifications";
export default class UserDropdown extends Component {

View File

@ -1,6 +1,6 @@
import { fn } from "@ember/helper";
import { or } from "truth-helpers";
import DButton from "discourse/components/d-button";
import or from "truth-helpers/helpers/or";
const ShareSource = <template>
<DButton

View File

@ -5,6 +5,7 @@ import { concat, fn, get } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { gt, includes, not } from "truth-helpers";
import EditNavigationMenuModal from "discourse/components/sidebar/edit-navigation-menu/modal";
import borderColor from "discourse/helpers/border-color";
import categoryBadge from "discourse/helpers/category-badge";
@ -15,9 +16,6 @@ import Category from "discourse/models/category";
import { INPUT_DELAY } from "discourse-common/config/environment";
import i18n from "discourse-common/helpers/i18n";
import discourseDebounce from "discourse-common/lib/debounce";
import gt from "truth-helpers/helpers/gt";
import includes from "truth-helpers/helpers/includes";
import not from "truth-helpers/helpers/not";
// Given a list, break into chunks starting a new chunk whenever the predicate
// is true for an element.

View File

@ -3,12 +3,12 @@ import { tracked } from "@glimmer/tracking";
import { hash } from "@ember/helper";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { and } from "truth-helpers";
import DButton from "discourse/components/d-button";
import avatar from "discourse/helpers/bound-avatar-template";
import { groupPath } from "discourse/lib/url";
import dIcon from "discourse-common/helpers/d-icon";
import I18n from "discourse-i18n";
import and from "truth-helpers/helpers/and";
export default class PrivateMessageMap extends Component {
@service site;

View File

@ -1,5 +1,6 @@
import Component from "@glimmer/component";
import { htmlSafe } from "@ember/template";
import { gt } from "truth-helpers";
import DButton from "discourse/components/d-button";
import RelativeDate from "discourse/components/relative-date";
import TopicParticipants from "discourse/components/topic-map/topic-participants";
@ -7,7 +8,6 @@ import number from "discourse/helpers/number";
import slice from "discourse/helpers/slice";
import i18n from "discourse-common/helpers/i18n";
import { avatarImg } from "discourse-common/lib/avatar-utils";
import gt from "truth-helpers/helpers/gt";
export default class TopicMapSummary extends Component {
get toggleMapButton() {

View File

@ -1,9 +1,9 @@
import Component from "@glimmer/component";
import { htmlSafe } from "@ember/template";
import { gt } from "truth-helpers";
import UserAvatarFlair from "discourse/components/user-avatar-flair";
import { userPath } from "discourse/lib/url";
import { avatarImg } from "discourse-common/lib/avatar-utils";
import gt from "truth-helpers/helpers/gt";
const addTopicParticipantClassesCallbacks = [];

View File

@ -33,3 +33,34 @@ loaderShim("js-yaml", () => importSync("js-yaml"));
loaderShim("message-bus-client", () => importSync("message-bus-client"));
loaderShim("virtual-dom", () => importSync("virtual-dom"));
loaderShim("xss", () => importSync("xss"));
loaderShim("truth-helpers", () => importSync("truth-helpers"));
loaderShim("truth-helpers/helpers/and", () =>
importSync("truth-helpers/helpers/and")
);
loaderShim("truth-helpers/helpers/eq", () =>
importSync("truth-helpers/helpers/eq")
);
loaderShim("truth-helpers/helpers/gt", () =>
importSync("truth-helpers/helpers/gt")
);
loaderShim("truth-helpers/helpers/gte", () =>
importSync("truth-helpers/helpers/gte")
);
loaderShim("truth-helpers/helpers/includes", () =>
importSync("truth-helpers/helpers/includes")
);
loaderShim("truth-helpers/helpers/lt", () =>
importSync("truth-helpers/helpers/lt")
);
loaderShim("truth-helpers/helpers/lte", () =>
importSync("truth-helpers/helpers/lte")
);
loaderShim("truth-helpers/helpers/not-eq", () =>
importSync("truth-helpers/helpers/not-eq")
);
loaderShim("truth-helpers/helpers/not", () =>
importSync("truth-helpers/helpers/not")
);
loaderShim("truth-helpers/helpers/or", () =>
importSync("truth-helpers/helpers/or")
);

View File

@ -76,7 +76,9 @@ module.exports = function (defaults) {
trees: {
app: RawHandlebarsCompiler(
withSideWatch("app", { watching: ["../discourse-markdown-it"] })
withSideWatch("app", {
watching: ["../discourse-markdown-it", "../truth-helpers"],
})
),
},
});

View File

@ -1,8 +1,8 @@
import { concat, fn, hash } from "@ember/helper";
import { or } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import or from "truth-helpers/helpers/or";
const DDefaultToast = <template>
<div

View File

@ -1,9 +1,9 @@
import Component from "@glimmer/component";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { inject as service } from "@ember/service";
import { and } from "truth-helpers";
import DInlineFloat from "float-kit/components/d-inline-float";
import { TOOLTIP } from "float-kit/lib/constants";
import and from "truth-helpers/helpers/and";
export default class DInlineTooltip extends Component {
@service tooltip;

View File

@ -3,11 +3,11 @@ import { tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/application";
import { inject as service } from "@ember/service";
import { modifier } from "ember-modifier";
import { and } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import DFloatBody from "float-kit/components/d-float-body";
import DTooltipInstance from "float-kit/lib/d-tooltip-instance";
import and from "truth-helpers/helpers/and";
export default class DTooltip extends Component {
@service tooltip;

View File

@ -0,0 +1,4 @@
"use strict";
const { addonV1Shim } = require("@embroider/addon-shim");
module.exports = addonV1Shim(__dirname);

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/and";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/eq";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/gt";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/gte";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/includes";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/lt";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/lte";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/not-eq";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/not";

View File

@ -0,0 +1 @@
export { default } from "truth-helpers/helpers/or";

View File

@ -1,27 +0,0 @@
"use strict";
const EmberAddon = require("ember-cli/lib/broccoli/ember-addon");
module.exports = function (defaults) {
const app = new EmberAddon(defaults, {
autoImport: {
publicAssetURL: "",
},
});
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
const { maybeEmbroider } = require("@embroider/test-setup");
return maybeEmbroider(app, {
skipBabel: [
{
package: "qunit",
},
],
});
};

View File

@ -1,9 +0,0 @@
"use strict";
module.exports = {
name: require("./package").name,
options: {},
isDevelopingAddon() {
return true;
},
};

View File

@ -1,40 +1,25 @@
{
"name": "truth-helpers",
"version": "1.0.0",
"private": true,
"description": "Partial copy of ember truth helpers",
"author": "Discourse",
"license": "GPL-2.0-only",
"keywords": [
"ember-addon"
],
"scripts": {
"build": "ember build",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve"
"exports": {
".": "./src/index.js",
"./*": "./src/*.js",
"./addon-main.js": "./addon-main.cjs"
},
"files": [
"addon-main.cjs",
"src"
],
"dependencies": {
"@babel/core": "^7.24.0",
"ember-auto-import": "^2.7.2",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0"
},
"devDependencies": {
"@ember/optional-features": "^2.1.0",
"@embroider/test-setup": "^3.0.3",
"@glimmer/component": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
"ember-cli": "~5.6.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-load-initializers": "^2.1.1",
"ember-resolver": "^11.0.1",
"ember-source": "~5.5.0",
"ember-source-channel-url": "^3.0.0",
"loader.js": "^4.7.0",
"webpack": "^5.90.3"
"@embroider/addon-shim": "^1.8.7",
"ember-auto-import": "^2.7.2"
},
"engines": {
"node": ">= 18",
@ -42,6 +27,23 @@
"yarn": ">= 1.21.1"
},
"ember": {
"edition": "default"
"edition": "octane"
},
"ember-addon": {
"version": 2,
"type": "addon",
"main": "addon-main.cjs",
"app-js": {
"./helpers/and.js": "./app/helpers/and.js",
"./helpers/eq.js": "./app/helpers/eq.js",
"./helpers/gt.js": "./app/helpers/gt.js",
"./helpers/gte.js": "./app/helpers/gte.js",
"./helpers/includes.js": "./app/helpers/includes.js",
"./helpers/lt.js": "./app/helpers/lt.js",
"./helpers/lte.js": "./app/helpers/lte.js",
"./helpers/not-eq.js": "./app/helpers/not-eq.js",
"./helpers/not.js": "./app/helpers/not.js",
"./helpers/or.js": "./app/helpers/or.js"
}
}
}

View File

@ -0,0 +1,10 @@
export { default as and } from "./helpers/and.js";
export { default as eq } from "./helpers/eq.js";
export { default as gt } from "./helpers/gt.js";
export { default as gte } from "./helpers/gte.js";
export { default as includes } from "./helpers/includes.js";
export { default as lt } from "./helpers/lt.js";
export { default as lte } from "./helpers/lte.js";
export { default as notEq } from "./helpers/not-eq.js";
export { default as not } from "./helpers/not.js";
export { default as or } from "./helpers/or.js";

View File

@ -4,11 +4,11 @@ import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import { and } from "truth-helpers";
import PluginOutlet from "discourse/components/plugin-outlet";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import and from "truth-helpers/helpers/and";
import ChatChannelRow from "./chat-channel-row";
export default class ChannelsListPublic extends Component {

View File

@ -2,12 +2,12 @@ import Component from "@glimmer/component";
import { hash } from "@ember/helper";
import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import { gt } from "truth-helpers";
import borderColor from "discourse/helpers/border-color";
import concatClass from "discourse/helpers/concat-class";
import replaceEmoji from "discourse/helpers/replace-emoji";
import dIcon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import gt from "truth-helpers/helpers/gt";
import ToggleChannelMembershipButton from "./toggle-channel-membership-button";
export default class ChatChannelCard extends Component {

View File

@ -8,14 +8,13 @@ import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { modifier } from "ember-modifier";
import { and, eq } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import replaceEmoji from "discourse/helpers/replace-emoji";
import { popupAjaxError } from "discourse/lib/ajax-error";
import icon from "discourse-common/helpers/d-icon";
import { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import and from "truth-helpers/helpers/and";
import eq from "truth-helpers/helpers/eq";
import ChannelIcon from "discourse/plugins/chat/discourse/components/channel-icon";
import ChannelName from "discourse/plugins/chat/discourse/components/channel-name";
import ChatChannelMetadata from "discourse/plugins/chat/discourse/components/chat-channel-metadata";

View File

@ -8,6 +8,7 @@ import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { cancel, next, schedule } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { and, not } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { resetIdle } from "discourse/lib/desktop-notifications";
@ -19,8 +20,6 @@ import {
import i18n from "discourse-common/helpers/i18n";
import discourseDebounce from "discourse-common/lib/debounce";
import { bind } from "discourse-common/utils/decorators";
import and from "truth-helpers/helpers/and";
import not from "truth-helpers/helpers/not";
import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status";
import ChatChannelSubscriptionManager from "discourse/plugins/chat/discourse/lib/chat-channel-subscription-manager";
import {

View File

@ -1,9 +1,9 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { eq } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import i18n from "discourse-common/helpers/i18n";
import eq from "truth-helpers/helpers/eq";
import {
UnreadChannelsIndicator,
UnreadDirectMessagesIndicator,

View File

@ -10,11 +10,11 @@ import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { schedule } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { createPopper } from "@popperjs/core";
import { and } from "truth-helpers";
import BookmarkIcon from "discourse/components/bookmark-icon";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import DropdownSelectBox from "select-kit/components/dropdown-select-box";
import and from "truth-helpers/helpers/and";
import ChatMessageReaction from "discourse/plugins/chat/discourse/components/chat-message-reaction";
import chatMessageContainer from "discourse/plugins/chat/discourse/lib/chat-message-container";
import ChatMessageInteractor from "discourse/plugins/chat/discourse/lib/chat-message-interactor";

View File

@ -6,12 +6,11 @@ import { on } from "@ember/modifier";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { inject as service } from "@ember/service";
import { and, or } from "truth-helpers";
import BookmarkIcon from "discourse/components/bookmark-icon";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import discourseLater from "discourse-common/lib/later";
import and from "truth-helpers/helpers/and";
import or from "truth-helpers/helpers/or";
import ChatMessageReaction from "discourse/plugins/chat/discourse/components/chat-message-reaction";
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
import ChatMessageInteractor from "discourse/plugins/chat/discourse/lib/chat-message-interactor";

View File

@ -5,9 +5,9 @@ import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { modifier } from "ember-modifier";
import { and } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import { emojiUnescape, emojiUrlFor } from "discourse/lib/text";
import and from "truth-helpers/helpers/and";
import { getReactionText } from "discourse/plugins/chat/discourse/lib/get-reaction-text";
export default class ChatMessageReaction extends Component {

View File

@ -11,6 +11,7 @@ import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { cancel, schedule } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { modifier } from "ember-modifier";
import { eq, not } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import optionalService from "discourse/lib/optional-service";
@ -19,8 +20,6 @@ import discourseDebounce from "discourse-common/lib/debounce";
import discourseLater from "discourse-common/lib/later";
import { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import eq from "truth-helpers/helpers/eq";
import not from "truth-helpers/helpers/not";
import ChatMessageAvatar from "discourse/plugins/chat/discourse/components/chat/message/avatar";
import ChatMessageError from "discourse/plugins/chat/discourse/components/chat/message/error";
import ChatMessageInfo from "discourse/plugins/chat/discourse/components/chat/message/info";

View File

@ -5,7 +5,7 @@ import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import and from "truth-helpers/helpers/and";
import { and } from "truth-helpers";
import resizableNode from "../modifiers/chat/resizable-node";
import ChatSidePanelResizer from "./chat-side-panel-resizer";

View File

@ -2,11 +2,11 @@ import Component from "@glimmer/component";
import { cached } from "@glimmer/tracking";
import { inject as service } from "@ember/service";
import { modifier } from "ember-modifier";
import { eq } from "truth-helpers";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import isElementInViewport from "discourse/lib/is-element-in-viewport";
import { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import eq from "truth-helpers/helpers/eq";
import ChatThreadListItem from "discourse/plugins/chat/discourse/components/chat/thread-list/item";
import ChatTrackMessage from "discourse/plugins/chat/discourse/modifiers/chat/track-message";

View File

@ -4,8 +4,8 @@ import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { eq } from "truth-helpers";
import { isAudio, isImage, isVideo } from "discourse/lib/uploads";
import eq from "truth-helpers/helpers/eq";
export default class ChatUpload extends Component {
@service siteSettings;

View File

@ -1,10 +1,10 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { gte } from "truth-helpers";
import DButton from "discourse/components/d-button";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "discourse-i18n";
import gte from "truth-helpers/helpers/gte";
import MembersCount from "./members-count";
import MembersSelector from "./members-selector";

View File

@ -1,8 +1,7 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { gt, not } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import gt from "truth-helpers/helpers/gt";
import not from "truth-helpers/helpers/not";
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
export default class Channel extends Component {

View File

@ -2,9 +2,9 @@ import Component from "@glimmer/component";
import { fn } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { eq } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import I18n from "discourse-i18n";
import eq from "truth-helpers/helpers/eq";
import Channel from "./channel";
import Group from "./group";
import ListAction from "./list-action";

View File

@ -1,8 +1,8 @@
import { fn } from "@ember/helper";
import { eq } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import eq from "truth-helpers/helpers/eq";
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
const Member = <template>

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { gte } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import I18n from "discourse-i18n";
import gte from "truth-helpers/helpers/gte";
export default class MembersCount extends Component {
get countLabel() {

View File

@ -3,9 +3,9 @@ import { Input } from "@ember/component";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { eq } from "truth-helpers";
import icon from "discourse-common/helpers/d-icon";
import I18n from "discourse-i18n";
import eq from "truth-helpers/helpers/eq";
import { getNext, getPrevious } from "./lib/iterate-list";
import Member from "./member";

View File

@ -3,10 +3,10 @@ import { tracked } from "@glimmer/tracking";
import { Input } from "@ember/component";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { gte } from "truth-helpers";
import DButton from "discourse/components/d-button";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "discourse-i18n";
import gte from "truth-helpers/helpers/gte";
import MembersCount from "./members-count";
import MembersSelector from "./members-selector";

View File

@ -1,11 +1,10 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { modifier } from "ember-modifier";
import { gt, not } from "truth-helpers";
import UserStatusMessage from "discourse/components/user-status-message";
import userStatus from "discourse/helpers/user-status";
import I18n from "discourse-i18n";
import gt from "truth-helpers/helpers/gt";
import not from "truth-helpers/helpers/not";
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
import ChatUserDisplayName from "discourse/plugins/chat/discourse/components/chat-user-display-name";

View File

@ -1,7 +1,7 @@
import { fn } from "@ember/helper";
import { eq } from "truth-helpers";
import DButton from "discourse/components/d-button";
import i18n from "discourse-common/helpers/i18n";
import eq from "truth-helpers/helpers/eq";
const Error = <template>
{{#if @message.error}}

View File

@ -3,6 +3,7 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import { and } from "truth-helpers";
import BookmarkIcon from "discourse/components/bookmark-icon";
import UserStatusMessage from "discourse/components/user-status-message";
import concatClass from "discourse/helpers/concat-class";
@ -10,7 +11,6 @@ import { prioritizeNameInUx } from "discourse/lib/settings";
import dIcon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import { bind } from "discourse-common/utils/decorators";
import and from "truth-helpers/helpers/and";
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
import formatChatDate from "../../../helpers/format-chat-date";

View File

@ -1,9 +1,9 @@
import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import { eq } from "truth-helpers";
import BookmarkIcon from "discourse/components/bookmark-icon";
import dIcon from "discourse-common/helpers/d-icon";
import eq from "truth-helpers/helpers/eq";
import formatChatDate from "../../../helpers/format-chat-date";
export default class ChatMessageLeftGutter extends Component {

View File

@ -2,13 +2,13 @@ import Component from "@glimmer/component";
import { getOwner } from "@ember/application";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { not } from "truth-helpers";
import DButton from "discourse/components/d-button";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { clipboardCopyAsync } from "discourse/lib/utilities";
import { isTesting } from "discourse-common/config/environment";
import { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import not from "truth-helpers/helpers/not";
import ChatModalMoveMessageToChannel from "discourse/plugins/chat/discourse/components/chat/modal/move-message-to-channel";
export default class ChatSelectionManager extends Component {

View File

@ -3,11 +3,11 @@ import { fn } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { gt } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import formatDate from "discourse/helpers/format-date";
import replaceEmoji from "discourse/helpers/replace-emoji";
import i18n from "discourse-common/helpers/i18n";
import gt from "truth-helpers/helpers/gt";
import ThreadUnreadIndicator from "discourse/plugins/chat/discourse/components/thread-unread-indicator";
import ChatThreadParticipants from "../../chat-thread-participants";
import ChatUserAvatar from "../../chat-user-avatar";

View File

@ -3,11 +3,11 @@ import { cached } from "@glimmer/tracking";
import { array } from "@ember/helper";
import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import { or } from "truth-helpers";
import ReviewableCreatedBy from "discourse/components/reviewable-created-by";
import ReviewablePostHeader from "discourse/components/reviewable-post-header";
import htmlSafe from "discourse-common/helpers/html-safe";
import i18n from "discourse-common/helpers/i18n";
import or from "truth-helpers/helpers/or";
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";